In Gram-positive bacteria, sortase enzymes assemble surface proteins and pili in the cell wall envelope. Sortases catalyze a transpeptidation reaction that joins a highly conserved LPXTG sorting signal within their polypeptide substrate to the cell wall or to other pilin subunits. The molecular basis of transpeptidation and sorting signal recognition are not well understood, because the intermediates of catalysis are short lived. We have overcome this problem by synthesizing an analog of the LPXTG signal whose stable covalent complex with the enzyme mimics a key thioacyl catalytic intermediate. Here we report the solution structure and dynamics of its covalent complex with the Staphylococcus aureus SrtA sortase. In marked contrast to a previously reported crystal structure, we show that SrtA adaptively recognizes the LPXTG sorting signal by closing and immobilizing an active site loop. We have also used chemical shift mapping experiments to localize the binding site for the triglycine portion of lipid II, the second substrate to which surface proteins are attached. We propose a unified model of the transpeptidation reaction that explains the functions of key active site residues. Since the sortase-catalyzed anchoring reaction is required for the virulence of a number of bacterial pathogens, the results presented here may facilitate the development of new anti-infective agents.Bacterial surface proteins function as virulence factors that enable pathogens to adhere to sites of infection, evade the immune response, acquire essential nutrients, and enter host cells (1). Gram-positive bacteria use a common mechanism to covalently attach proteins to the cell wall. This process is catalyzed by sortase transpeptidase enzymes, which join proteins bearing a highly conserved Leu-Pro-X-Thr-Gly (LPXTG, where X is any amino acid) sorting signal to the cross-bridge peptide of the peptidylglycan (2-4). Sortases also polymerize proteins containing sorting signals into pili, filamentous surface exposed structures that promote bacterial adhesion (5, 6). The search for small molecule sortase inhibitors is an active area of research, since these enzymes contribute to the virulence of a number of important pathogens, including among others Staphylococcus aureus, Listeria monocytogenes, Streptococcus pyogenes, and Streptococcus pneumoniae (reviewed in Refs. 7 and 8). Sortase enzymes are also promising molecular biology reagents that can be used to site-specifically attach proteins to a variety of biomolecules (9 -14, 72).The sortase A (SrtA) 7 enzyme from S. aureus is the prototypical member of the sortase enzyme family (15, 16). It anchors proteins to the murein sacculus that possess a COOH-terminal cell wall sorting signal that consists of a LPXTG motif, followed by a hydrophobic segment of amino acids and a tail composed of mostly positively charged residues (17). SrtA is located on the extracellular side of the membrane. After partial secretion of its protein substrate across the cell membrane, SrtA cleaves the LPXTG motif between...