Transpeptidase that anchors surface proteins to the cell wall (PubMed:11854224, PubMed:11929538, PubMed:16247833, PubMed:22837151). Recognizes and modifies its substrate by proteolytic cleavage of a C-terminal sorting signal. Following cleavage, a covalent intermediate is formed via a thioester bond between the sortase and its substrate, which is then transferred and covalently attached to the cell wall (Probable). This sortase recognizes a Leu-Pro-x-Thr-Gly (LPXTG) motif, which is cleaved by the sortase between the threonine and glycine residues (PubMed:11929538). Involved in pathogenesis (PubMed:11854224, PubMed:11929538, PubMed:15028680). May regulate the rate of synthesis and/or the stability of a subset of LPXTG proteins (PubMed:22837151). Not involved in cell wall-anchoring of Hbp2 (SvpA) or Hbp1 (PubMed:15028680, PubMed:16247833). Activity is enhanced by Zn(2+) and strongly enhanced by Ca(2+). Inhibited by chalcone, a precursor of several flavonoids, which blocks the SrtA active site. Seems to contribute mostly when the bacteria reach stationary phase. Mutant is defective in processing and surface anchoring of internalins and several other LPXTG-containing proteins (PubMed:11854224, PubMed:11929538, PubMed:22837151, PubMed:16247833). Mutant is significantly less invasive in vitro and is attenuated in virulence in a mouse model of infection (PubMed:11854224, PubMed:11929538). Deletion of the gene does not affect expression of the genes encoding LPXTG surface proteins (PubMed:22837151). A double srtA-srtB deletion mutant has no cell wall-anchored proteins, and is as impaired in virulence as a single srtA mutant (PubMed:15028680). Belongs to the bacterial sortase family. Class A subfamily.