As a crucial drug target, KRAS can regulate most cellular processes involving guanosine triphosphate (GTP) hydrolysis. However, the mechanism of GTP hydrolysis has remained controversial over the past decades. Here, several different GTP hydrolysis mechanisms catalyzed by wild-type KRAS (WT-KRAS) and KRASG12R mutants were discussed via four QM/MM calculation models. Based on the computational results, a Mg2+-coordinated H2O-mediated GTP hydrolysis mechanism was proposed. In this mechanism, a Mg2+-coordinated H2O first protonates the fully deprotonated GTP, and then the Mg2+ coordinated hydroxyl anion is generated. The Pγ-O bond is formed via the SN2 attack of the second H2O on the Pγ atom of the GTP, leading to the simultaneous cleavage of the Pγ-O bond. Meanwhile, the hydroxyl anion coordinated to Mg2+ and generated in the first step acts as a proton acceptor from water. This Mg2+ coordinated H2O-involved GTP hydrolysis mechanism may also be suitable for Mg2+-catalyzed ATP hydrolysis. Furthermore, the mechanism of GTP hydrolysis catalyzed by the KRASG12R mutant, whose hydrolysis rate was approximately 40-fold slower than WT-KRAS, was also discussed. Our QM/MM calculations reveal that GTP is easily protonated by the residue R12, and the energy barrier of GTP hydrolysis catalyzed by the KRASG12R mutant is lower than the corresponding barrier for WT-KRAS. Nevertheless, molecular dynamics (MD) simulations reveal that R12, a residue characterized by significant steric hindrance, is positioned at the GTP site where the nucleophilic attack by water occurs during Pγ-O bond formation, thereby strongly impeding the approach of water molecules to GTP. As a result, the GTP hydrolysis rate catalyzed by the KRASG12R mutant was severely impaired. Uncovering the GTP hydrolysis mechanism catalyzed by the WT-KRAS and KRASG12R mutant may also give a reasonable explanation for the relationship between the KRASG12R mutation and the occurrence of cancer. We hope this finding will provide useful guidance for drug discovery that targets KRAS.