Molecularly imprinted polymers were synthesized for selective detection of ciprofloxacin on magnetic nanoparticles via surface- initiated free radical polymerization. Methacrylic acid, ethylene glycol dimethacrylate, azobisisobutyronitrile and ciprofloxacin were used for the formation of molecularly imprinted layer as a functional monomer, cross linker, initiator and template molecule, respectively. The surface characterization of the prepared nanoparticles was carried out by using several methods such as TEM, XPS and VSM. The prepared imprinted nanoparticles had high binding capacity and fast adsorption kinetics. Additionally, the prepared nanoparticles showed superparamagnetic property with rapid magnetic separation and retained binding selectivity after ten adsorption-desorption cycles. The imprinted magnetic nanoparticles were subsequently applied for selective separation and determination of CPX from milk with high recoveries (98.0% - 98.8%) and low relative standard deviations (2.76% - 4.59%). All the results have shown that the developed new method is a good alternative for the selective separation of ciprofloxacin in complex medium.