CRISPR-Cas9 is a cutting-edge genome editing technology, which uses the endonuclease Cas9 to introduce mutations at desired sites of the genome. This revolutionary tool is promising to treat a myriad of human genetic diseases. Nevertheless, the molecular basis of DNA cleavage, which is a fundamental step for genome editing, has not been established. Here, quantum-classical molecular dynamics (MD) and free energy methods are used to disclose the two-metal-dependent mechanism of phosphodiester bond cleavage in CRISPR-Cas9. Ab initio MD reveals a conformational rearrangement of the Mg2+-bound RuvC active site, which entails the relocation of H983 to act as a general base. Then, the DNA cleavage proceeds through a concerted associative pathway fundamentally assisted by the joint dynamics of the two Mg2+ ions. This clarifies previous controversial experimental evidence, which could not fully establish the catalytic role of the conserved H983 and the metal cluster conformation. The comparison with other two-metal-dependent enzymes supports the identified mechanism and suggests a common catalytic strategy for genome editing and recombination. Overall, the non-target DNA cleavage catalysis described here resolves a fundamental open question in the CRISPR-Cas9 biology and provides valuable insights for improving the catalytic efficiency and the metal-dependent function of the Cas9 enzyme, which are at the basis of the development of genome editing tools.