Gram-negative pathogens commonly use the chaperone-usher pathway to assemble adhesive multisubunit fibers on their surface. In the periplasm, subunits are stabilized by a chaperone that donates a β strand to complement the subunits' truncated immunoglobulin-like fold. Pilus assembly proceeds through a "donor-strand exchange" (DSE) mechanism whereby this complementary β strand is replaced by the N-terminal extension (Nte) of an incoming pilus subunit. Using X-ray crystallography and real-time electrospray ionization mass spectrometry (ESI-MS), we demonstrate that DSE requires the formation of a transient ternary complex between the chaperone-subunit complex and the Nte of the next subunit to be assembled. The process is crucially dependent on an initiation site (the P5 pocket) needed to recruit the incoming Nte. The data also suggest a capping reaction displacing DSE toward product formation. These results support a zip-in-zip-out mechanism for DSE and a catalytic role for the usher, the molecular platform at which pili are assembled.