The development and characterization of novel, molecularly imprinted polymer nanofilament-based optical sensors for the analysis of enrofloxacin, an antibiotic widely used for human and veterinary applications, is reported. The polymers were prepared by nanomolding in porous alumina by using enrofloxacin as the template. The antibiotic was covalently immobilized on to the pore walls of the alumina by using different spacers, and the prepolymerization mixture was cast in the pores and the polymer synthesized anchored onto a glass support through UV polymerization. Various parameters affecting polymer selectivity were evaluated to achieve optimal recognition, namely, the spacer arm length and the binding solvent. The results of morphological characterization, binding kinetics, and selectivity of the optimized polymer material for ENR and its derivatives are reported. For sensing purposes, the nanofilaments were incubated in solutions of the target molecule in acetonitrile/HEPES buffer (100 mM, pH 7.5, 50:50, v/v) for 20 min followed by incubation in a 10 mM solution of europium(III) ions to generate a europium(III)–enrofloxacin complex on the polymer surface. The detection event was based on the luminescence of the rare-earth ion (λexc=340 nm; λem=612 nm) that results from energy transfer from the antibiotic excited state to the metal-ion emitting excited state. The limit of detection of the enrofloxacin antibiotic was found to be 0.58 μM.