β-Lactamases, which evolved from bacterial penicillin-binding proteins (PBPs) involved in peptidoglycan (PG) synthesis, confer resistance to β-lactam antibiotics. While investigating the genetic basis of biofilm development by Pseudomonas aeruginosa, we noted that plasmid vectors encoding the common β-lactamase marker TEM-1 caused defects in twitching motility (mediated by type IV pili), adherence and biofilm formation without affecting growth rates. Similarly, strains of Escherichia coli carrying TEM-1-encoding vectors grew normally but showed reduced adherence and biofilm formation, showing this effect was not species-specific. Introduction of otherwise identical plasmid vectors carrying tetracycline or gentamicin resistance markers had no effect on biofilm formation or twitching motility. The effect is restricted to class A and D enzymes, because expression of the class D Oxa-3 β-lactamase, but not class B or C β-lactamases, impaired biofilm formation by E. coli and P. aeruginosa. Site-directed mutagenesis of the catalytic Ser of TEM-1, but not Oxa-3, abolished the biofilm defect, while disruption of either TEM-1 or Oxa-3 expression restored wild-type levels of biofilm formation. We hypothesized that the A and D classes of β-lactamases, which are related to low molecular weight (LMW) PBPs, may sequester or alter the PG substrates of such enzymes and interfere with normal cell wall turnover. In support of this hypothesis, deletion of the E. coli LMW PBPs 4, 5 and 7 or combinations thereof, resulted in cumulative defects in biofilm formation, similar to those seen in β-lactamase-expressing transformants. Our results imply that horizontal acquisition of β-lactamase resistance enzymes can have a phenotypic cost to bacteria by reducing their ability to form biofilms. β-Lactamases likely affect PG remodelling, manifesting as perturbation of structures involved in bacterial adhesion that are required to initiate biofilm formation.