Many gram-positive pathogens possess external pili or fimbriae with which they adhere to host cells during the infection process. Unusual dual intramolecular isopeptide bonds between Asn and Lys side chains within the N-terminal and C-terminal domains of the pilus subunits have been observed initially in the Streptococcus pyogenes pilin subunit Spy0128 and subsequently in GBS52 from Streptococcus agalactiae, in the BcpA major pilin of Bacillus cereus and in the RrgB pilin of Streptococcus pneumoniae, among others. Within each pilin subunit, intramolecular isopeptide bonds serve to stabilize the protein. These bonds provide a means to withstand large external mechanical forces, as well as possibly assisting in supporting a conformation favored for pilin subunit polymerization via sortase transpeptidases. Genome-wide analyses of pili-containing gram-positive bacteria are known or suspected to contain isopeptide bonds in pilin subunits. For the autocatalytic formation of isopeptide cross-links, a conservation of three amino acids including Asn, Lys, and a catalytically important acidic Glu (or Asp) residue are responsible. However, the chemical mechanism of how isopeptide bonds form within pilin remains poorly understood. Although it is possible that several mechanistic paths could lead to isopeptide bond formation in pili, the requirement of a conserved glutamate and highly organized positioning of residues within the hydrophobic environment of the active site were found in numerous pilin crystal structures such as Spy0128 and RrgB. This suggests a mechanism involving direct coupling of lysine side chain amine to the asparagine carboxamide mediated by critical acid/base or hydrogen bonding interactions with the catalytic glutamate residue. From this mechanistic perspective, we used the QM/MM minimum free-energy path method to examine the reaction details of forming the isopeptide bonds with Spy0128 as a model pilin, specifically focusing on the role of the glutamate in catalysis. It was determined that the reaction mechanism likely consists of two major steps: the nucleophilic attack on Cγ by nitrogen in the unprotonated Lys ε-amino group and, then two concerted proton transfers occur during the formation of the intramolecular isopeptide bond to subsequently release ammonia. More importantly, within the dual active sites of Spy0128, Glu(117), and Glu(258) residues function as crucial catalysts for each isopeptide bond formation, respectively, by relaying two proton transfers. This work also suggests that domain-domain interactions within Spy0128 may modulate the reactivity of residues within each active site. Our results may hopefully shed light on the molecular mechanisms of pilin biogenesis in gram-positive bacteria.