A new magnetic molecularly imprinted polymer was coupled with ultra high performance liquid chromatography and tandem mass spectrometry for the selective determination of melamine in milk powder. The magnetic molecularly imprinted polymer has been prepared by using carbon nanotubes as the matrix, Fe O particles as the magnetic ingredient, melamine as the template molecule, methacrylic acid as the functional monomer, ethylene glycol dimethacrylate as the cross-linker and polyvinylpyrrolidone as the dispersant. The polymer was characterized with scanning electron microscopy, Fourier transform infrared spectroscopy and a physical property measurement system. The isothermal adsorption, kinetics adsorption, and selectivity were studied to evaluate the rebinding properties of the magnetic molecularly imprinted polymer. Various parameters affecting the extraction efficiency such as the amount of polymer, extraction time, and eluting solution were evaluated. The limit of detection was 0.00075 mg/kg. The relative standard deviations of the intraday and interday precision are 0.4-2.7 and 2.3-5.1%, respectively. The proposed method was successfully applied to determine melamine in different milk powder samples from different provenances, and satisfactory recoveries of 89.0-95.6% were obtained. This method has great significance for quality control and is simple and suitable for the rapid determination of melamine in milk powder.