This work describes the development and application of class-selective molecularly imprinted polymers (MIPs) for the analysis of beta-lactamase-resistant penicillins, namely cloxacillin (CLOXA), oxacillin (OXA), and dicloxacillin (DICLOXA), in milk samples. Our method is based on molecularly imprinted solid-phase extraction (MISPE) coupled to high-performance liquid chromatography (HPLC) with diode-array detection (DAD). 2-Biphenylylpenicillin (2BPEN), a surrogate with a close resemblance to beta-lactamase-resistant penicillins in terms of size, shape, hydrophobicity, and functionality, was synthesized and used as the template for the polymer synthesis. A MIP library was prepared and screened to select the optimum functional monomer, N-(2-aminoethyl)methacrylamide, and cross-linker, trimethylolpropane trimethacrylate, that provided the best recognition for the target antibiotics. For the MISPE application, the MIPs were prepared in the form of microspheres, using porous silica beads (40-75 μm) as sacrificial scaffolds. The developed MISPE method enables efficient extraction from aqueous samples and analysis of the antimicrobials, when followed by a selective washing with 2 mL acetonitrile-water (20:80 v/v) and elution with 1 mL 0.05 mol L(-1) tetrabutylammonium in methanol. The analytical method was validated according to EU guideline 2002/657/EC. The limits of quantification (S/N = 10) were in the 5.3-6.3 μg kg(-1) range, well below the maximum residue limits (MRLs) currently established. Inter-day mean recoveries were in the range 99-102 % with RSDs below 9 %, improving on the performance of previously reported MISPE methods for the analysis of CLOXA, OXA, or DICLOXA in milk samples.