Sortase A (SrtA), a transpeptidase, anchors surface proteins with an LPXTG-motif sorting signal to the cell envelope. To determine the role of SrtA in the pathogenesis of Staphylococcus aureus, we constructed a mutant strain, ∆SrtA, by genetic techniques and identified its functions in a S. aureus-induced mastitis mouse model. The histological and myeloperoxidase (MPO) level results showed that the ∆SrtA strain attenuated the inflammatory reaction in the mammary tissue of mice compared with wild-type S. aureus challenge. Additionally, the ELISA results showed that the ∆SrtA strain impaired the induction of pro-inflammatory cytokines such as tumor necrosis factor-α (TNF-α), interleukin-1β (IL-1β) and interleukin-6 (IL-6), and the Western blot results showed that the mutant strain blocked the activation of nuclear factor-κB (NF-κB) and mitogen-activated protein kinases (MAPKs) by attenuating the degradation and phosphorylation of signaling pathway molecules such as IκBα, p65 and p38. These results suggest that SrtA is a key virulence factor in the pathogenesis of S. aureus-induced mastitis in mice. It appears that the srtA mutant affected the attachment of S. aureus to host cells, thus attenuating the activation of the NF-κB and MAPK signaling pathways, which regulated the expression of pro-inflammatory cytokines and decreased the susceptibility to mastitis.