A straightforward method has been developed for selective separation of chloramphenicol (CAP) from marine sediment samples. Magnetic molecularly imprinted nanoparticles (NPs) of type Fe3O4@SiO2 were prepared via surface imprinting with CAP. The NPs were characterized by Fourier transform infrared spectroscopy, transmission electron microscopy and thermogravimetric analysis. They have perfect core-shell structure, excellent thermal stability, high affinity and selectivity to CAP. The imprinting factor and Scatchard analysis also reveal good specific recognition to the template. The imprinted NPs were applied as sorbents for fast and selective extraction of CAP from marine sediment samples. The experimental parameters affecting separation efficiency were optimized. Three marine sediment samples were analyzed. Following desorption with methanol/water (90/10,v/v), CAP was quantified by HPLC with DAD detection. The limit of detection is 0.1 μg L-1 with a good linear response between 0.1-20 mg L-1 of CAP concentration (R2 = 0.999, n = 3). The method exhibits satisfactory recoveries from spiked samples (77.9-102.5%) and has low relative standard deviations (<6.3%). The magnetic material can be used at least 5 times by the regeneration without any loss of selectivity and adsorption capability. Graphical abstract Schematic presentation of magnetic molecularly imprinted nanoparticles (MMIPs) as sorbent for fast extraction and chromatographic analysis of chloramphenicol (CAP) from marine sediments. CAP-MMIPs are synthesized by surface imprinting method using 3-methacryloxy propyl trimethoxy silane (MPS) as the silane coupling agent.