Fluoroquinolones are considered as gold standard for the prevention of bacterial infections. To improve assessment of antibacterial efficacy, a novel method for determination of levofloxacin was developed and validated. Deep eutectic solvents (DESs) as only green solvent were used as a porogen for preparation of water-compatible molecularly imprinted polymers (MIPs) with a pseudotemplate. The DESs-MIPs were characterized in detail, including scanning electron microscope, nitrogen sorption porosimetry, and Fourier transform-infrared spectra. Clearly, the maximum binding capacity of levofloxacin on DESs-MIPs in water and methanol was 0.216 and 0.077 μmol g−1, respectively. The DESs-MIPs as adsorbing materials were applied in microextraction by packed sorbent (MEPS), and the DESs-MIPs-MEPS conditions were optimized. The DESs-MIPs-MEPS coupled with ultra-high-performance liquid chromatography (UHPLC) was used to determine levofloxacin in human plasma. The method was found linear over 0.05–10 μg mL−1 with coefficient of correlation equal to 0.9988. The limit of detection and limit of quantification were 0.012 and 0.04 μg mL−1, respectively. At three spiked levels, the precision of proposed method was between 95.3% and 99.7% with intraday and interday relative standard deviations ≤8.9%. Finally, the developed method was used to examine levofloxacin from human plasma of 20 hospitalized patients after transrectal ultrasound-guided prostate biopsy, and the average concentration (±SD) of levofloxacin was 2.35 ± 0.99 μg mL−1 in plasma.