Cell shape and cell-envelope integrity of bacteria are determined by the peptidoglycan cell wall. In rod-shaped Escherichia coli, two conserved sets of machinery are essential for cell-wall insertion in the cylindrical part of the cell, the Rod complex and the class-A penicillin-binding proteins (aPBPs). While the Rod complex governs rod-like cell shape, aPBP function is less well understood. aPBPs were previously hypothesized to either work in concert with the Rod complex or to independently repair cell-wall defects. First, we demonstrate through modulation of enzyme levels that class-A PBPs do not contribute to rod-like cell shape but are required for mechanical stability, supporting their independent activity. By combining measurements of cell-wall stiffness, cell-wall insertion, and PBP1b motion at the single-molecule level we then demonstrate that PBP1b, the major class-A PBP, contributes to cell-wall integrity by localizing and inserting peptidoglycan in direct response to local cell-wall defects.