The accurate detection and dosimetry of neutrons in mixed and pulsed radiation fields is a demanding instrumental issue with great interest both for the industrial and medical communities. In recent studies of neutron contamination around medical linacs, there is a growing concern about the secondary cancer risk for radiotherapy patients undergoing treatment in photon modalities at energies greater than 6 MV. In this work we present a promising alternative to standard detectors with an active method to measure neutrons around a medical linac using a novel ultra-thin silicon detector with 3D electrodes adapted for neutron detection. The active volume of this planar device is only 10 µm thick, allowing a high gamma rejection, which is necessary to discriminate the neutron signal in the radiotherapy peripheral radiation field with a high gamma background. Different tests have been performed in a clinical facility using a Siemens PRIMUS linac at 6 and 15 MV. The results show a good thermal neutron detection efficiency around 2% and a high gamma rejection factor.