P pili are important adhesive fibers involved in kidney infection by uropathogenic Escherichia coli. Pilus subunits are characterized by a large groove resulting from lack of a β strand. Polymerization of pilus subunits occurs via the donor-strand exchange (DSE) mechanism initiated when the N terminus of an incoming subunit interacts with the P5 region/pocket of the previously assembled subunit groove. Here, we solve the structure of the PapD:PapF complex in order to understand why PapF undergoes slow DSE. The structure reveals that the PapF P5 pocket is partially obstructed. MD simulations show this region of PapF is flexible compared with its equivalent in PapH, a subunit that also has an obstructed P5 pocket and is unable to undergo DSE. Using electrospray-ionization mass spectrometry, we show that mutations in the P5 region result in increased DSE rates. Thus, partial obstruction of the P5 pocket serves as a modulating mechanism of DSE.