CRISPR-Cas9 is the forefront technology for editing the genome. In this system, the Cas9 protein is programmed with guide RNAs to process DNA sequences that match the guide RNA forming an RNA:DNA hybrid structure. However, the binding of DNA sequences that do not fully match the guide RNA can limit the applicability of CRISPR-Cas9 for genome editing, resulting in the so-called off-target effects. Here, molecular dynamics is used to probe the effect of DNA base pair mismatches within the RNA:DNA hybrid in CRISPR-Cas9. Molecular simulations revealed that the presence of mismatched pairs in the DNA at distal sites with respect to the Protospacer Adjacent Motif (PAM) recognition sequence induces an extended opening of the RNA:DNA hybrid, leading to novel interactions established by the unwound nucleic acids and the protein counterpart. On the contrary, mismatched pairs upstream of the RNA:DNA hybrid are rapidly incorporated within the heteroduplex, with minor effect on the protein-nucleic acid interactions. As a result, mismatched pairs at PAM distal ends interfere with the activation of the catalytic HNH domain, while mismatches fully embedded in the RNA:DNA do not affect the HNH dynamics and enable its activation to cleave the DNA. These findings provide a mechanistic understanding to the intriguing experimental evidence that PAM distal mismatches hamper a proper function of HNH, explaining also why mismatches within the heteroduplex are much more tolerated. This constitutes a step forward in understanding off-target effects in CRISPR-Cas9, which encourages novel structure-based engineering efforts aimed at preventing the onset of off-target effects.