A hot-filament chemical-vapor deposition (HFCVD) technique was presented for the direct in situ synthesis of MgB 2 thin films. MgB 2 superconducting films were in situ prepared on (0001) sapphire substrates using this technique. The phase constituent, surface morphology, and the critical superconducting transition temperature of films were studied by X-ray diffraction (XRD) , scanning electron microscopy (SEM) , and DC SQUID magnetometer, respectively. Experimental results show that the formation of MgO impurities can be suppressed in MgB 2 films grown by this technique. As the substrate temperature increases from 400 to 600°C, both the crystallinity and densification of films increases, and superconducting critical transition temperatures of films increase from 18 to 36K. A phase-pure MgB 2 film can be obtained by depositing at 600°C for 30min.