In this study, the attapulgite nanoparticle was immobilized on the surface of magnetic nanoparticle Fe3O4 via a novel surface covalent reaction method for the magnetic solid phase extraction (MSPE) for the first time. The surface covalent reaction method has the advantages of controllable steps, and can make the magnetic attapulgite nanoparticle (MANP) have good homogeneity and high stability. Field emission scanning electron microscopy, equipped with an energy dispersive spectrometer, Nitrogen adsorption BET, X-ray diffraction and Fourier transform infrared spectroscopy were applied to characterize the prepared MANP, confirming that the attapulgite nanoparticle could be effectively immobilized on the surface of magnetic nanoparticle Fe3O4 via covalent reactions. Under optimal conditions of the MSPE experiment based on the MANP, the limits of detection were found to be 10ng/mL for melamine and 3ng/mL for cyromazine with a relative standard deviation < 10% by a high-performance liquid chromatography system. Meanwhile, 0.1mg/mL melamine in milk and 0.1mg/mL cyromazine in cucumber can also be detected according to our MSPE procedure. More importantly, the MANP still has good magnetism and enrichment efficiency after several decades of use. These results showed that the MANP prepared by our method is a kind of promising material for the MSPE.