The CRISPR-associated endonuclease Cas9 from Streptococcus pyogenes (spCas9) along with a single guide RNA (sgRNA) has emerged as a versatile toolbox for genome editing. Despite recent advances in the mechanism studies on spCas9-sgRNA-mediated double-stranded DNA (dsDNA) recognition and cleavage, it is still unclear how the catalytic Mg2+ ions induce the conformation changes toward the catalytic active state. It also remains controversial whether Cas9 generates blunt-ended or staggered-ended breaks with overhangs in the DNA. To investigate these issues, here we performed the first all-atom molecular dynamics simulations of the spCas9-sgRNA-dsDNA system with and without Mg2+ bound. The simulation results showed that binding of two Mg2+ ions at the RuvC domain active site could lead to structurally and energetically favorable coordination ready for the non-target DNA strand cleavage. Importantly, we demonstrated with our simulations that Cas9-catalyzed DNA cleavage produces 1-bp staggered ends rather than generally assumed blunt ends.