The cysteine protease enzyme legumain hydrolyzes peptide bonds with high specificity after asparagine and under more acidic conditions after aspartic acid [Baker, E. N. J. Mol. Biol. 1980, 141, 441484; Baker, E. N.; J. Mol. Biol. 1977, 111, 207210; Drenth, J.; Biochemistry 1976, 15, 37313738; Menard, R.; J. Cell. Biochem. 1994, 137; Polgar, L. Eur. J. Biochem. 1978, 88, 513521; Storer, A. C.; Methods Enzymol. 1994, 244, 486500. Remarkably, legumain additionally exhibits ligase activity that prevails at pH > 5.5. The atomic reaction mechanisms including their pH dependence are only partly understood. Here we present a density functional theory (DFT)-based quantum mechanics/molecular mechanics (QM/MM) study of the detailed reaction mechanism of both activities for human legumain in solution. Contrasting the situation in other papain-like proteases, our calculations reveal that the active site Cys189 must be present in the protonated state for a productive nucleophilic attack and simultaneous rupture of the scissile peptide bond, consistent with the experimental pH profile of legumain-catalyzed cleavages. The resulting thioester intermediate (INT1) is converted by water attack on the thioester into a second intermediate, a diol (INT2), which is released by proton abstraction by Cys189. Surprisingly, we found that ligation is not the exact reverse of the proteolysis but can proceed via two distinct routes. Whereas the transpeptidation route involves aminolysis of the thioester (INT1), at pH 6 a cysteine-independent, histidine-assisted ligation route was found. Given legumains important roles in immunity, cancer, and neurodegenerative diseases, our findings open up possibilities for targeted drug design in these fields.