A magnetic molecularly imprinted polymer (MMIP) was fabricated for captopril by surface polymerization of Fe3O4@SiO2 nanoparticles using a new functional monomer of N-(allylcarbamothioyl)-2-chlorobenzamide. It was then employed as a selective nanosorbent for dispersive magnetic micro solid phase extraction (DM-μ-SPE) of captopril from biological and wastewater samples. To characterize the physicochemical properties of the MMIP, different analytical methods such as the vibrating sample magnetometer, field emission scanning electron microscopy, Brunauer-Emmett-Teller, and Fourier transform infrared spectroscopy were utilized. To gain the maximum extraction recovery of captopril, the influence of various operating conditions was investigated and experimental settingsoptimized. After the extraction step, the concentration of captopril was measured by UV-Vis spectrophotometer at 245 nm. The assessments demonstrated that the MMIP provides higher extraction efficiency in comparison to magnetic non-imprinted polymer, suggesting the establishment of selective recognition binding sites at the MMIP surface. The method depicted desirable figures of merit of a low detection limit of 0.16 μg L-1, a limit of quantification of 0.50 μg L-1, a linear dynamic range of 0.50-22.0 μg L-1, and an acceptable preconcentration factor of 333. The magnetic MIP was successfully employed for preconcentration and extraction of trace amounts of captopril in real samples, such as human blood serum, urine, and wastewater samples, with recoveries in the range 95.7 to 102.6% and relative standard deviations < 5%.