Catalyzes distinct carboxypeptidation and transpeptidation reactions during the last stages of wall peptidoglycan synthesis. Mistaking a beta-lactam antibiotic molecule for a normal substrate (i.e. a D-alanyl-D-alanine-terminated peptide), it becomes immobilized in the form of a long-lived, serine-ester-linked acyl enzyme and thus behave as penicillin-binding protein (PBP). Preferential cleavage: (Ac)2-L-Lys-D-Ala-|-D-Ala. Also transpeptidation of peptidyl-alanyl moieties that are N-acyl substituents of D-alanine. Cell wall biogenesis; peptidoglycan biosynthesis. Belongs to the peptidase S12 family.