Many Gram-negative pathogens assemble architecturally and functionally diverse adhesive pili on their surfaces by the chaperone-usher pathway. Immunoglobulin-like periplasmic chaperones escort pilus subunits to the usher, a large protein complex that facilitates the translocation and assembly of subunits across the outer membrane. The crystal structure of the PapD-PapK chaperone-subunit complex, determined at 2.4 angstrom resolution, reveals that the chaperone functions by donating its G(1) beta strand to complete the immunoglobulin-like fold of the subunit via a mechanism termed donor strand complementation. The structure of the PapD-PapK complex also suggests that during pilus biogenesis, every subunit completes the immunoglobulin-like fold of its neighboring subunit via a mechanism termed donor strand exchange.