A magnetic molecularly imprinted electrochemical sensor was developed for selective determination of sufentanil (SUF) based on carbon paste electrode (CPE) modified with methacrylic acid‐ethylene glycol dimethacrylate‐coated Fe3O4 nanoparticles (Fe3O4@MAA‐EGDMA NPs). The structural properties, chemical structure, and electrochemical behaviors of the imprinted sensor were characterized by X‐ray diffraction analysis (XRD), Fourier transform infrared spectroscopy (FT‐IR), and square wave voltammetry (SWV), respectively. The prepared sensor revealed admirable recognition ability and selectivity for sufentanil. The substantial variables affecting the performance of extraction and SWV were considered and optimized by the batch mode experiment. Under optimal conditions, the method was capable of determining SUF in the range of 1.0×10‐9 to 6.0×10‐8 mol L‐1. The limit of detection (LOD) of sufentanil was found to be 0.2×10‐9 mol L‐1 (n = 10). The accuracy of the method was studied by recovery measurements on spiked samples. Admirable recovery results (96.0‐102.5%) with satisfactory relative standard deviation (RSD) were attained. According to the obtained results, the present method has high selectivity and reliability for the preconcentration and determination of sufentanil in various biological samples, including urine and plasma, without the use of sample pretreatments.