Three penicillin-based β-lactam antibiotics (benzylpenicillin, amoxicillin, and ampicillin) were extracted by electromembrane extraction (EME) and determined in the resulting extracts by capillary zone electrophoresis (CZE) with UV–Vis detection. The EME was optimized for the simultaneous clean-up of complex samples and preconcentration of the three antibiotics and employed 1-octanol as the organic phase interface (impregnated in the pores of a hollow fiber), acidified donor solution (pH 3), and phosphate buffer (pH 5.6) as the acceptor solution. The EMEs were carried out for 20 min at 300 V and constant stirring (750 rpm) of the donor solution. At the optimized EME-CZE conditions, the sensitivity of the analytical method was sufficient for the determination of the three β-lactam antibiotics in undiluted cow's milk at concentrations below the EU maximum residue limits (4 μg/L) in foodstuffs. The method was simple, rapid, and convenient and offered extraction recoveries of 13.5 – 87.3 %, enrichment factors of 23.6 – 152.8, repeatability (RSD values) better than 7.6 %, linear analytical response in the 1 – 100 μg/L (3 – 100 μg/L for benzylpenicillin) concentration range with correlation coefficients ≥ 0.9997, and limits of detection from 0.2 to 1.2 μg/L. The proposed analytical concept was used for the rapid control of milk quality (i.e. assessment of excessive use of antibiotics in dairy animals), moreover, it was further extended to the trace determination of β-lactam antibiotics in other complex samples, such as in wastewater.