A key limitation of the use of the CRISPR–Cas9 system for genome editing and other applications is the requirement that a protospacer adjacent motif (PAM) be present at the target site. For the most commonly used Cas9 from Streptococcus pyogenes (SpCas9), the required PAM sequence is NGG. No natural or engineered Cas9 variants that have been shown to function efficiently in mammalian cells offer a PAM less restrictive than NGG. Here we use phage-assisted continuous evolution to evolve an expanded PAM SpCas9 variant (xCas9) that can recognize a broad range of PAM sequences including NG, GAA and GAT. The PAM compatibility of xCas9 is the broadest reported, to our knowledge, among Cas9 proteins that are active in mammalian cells, and supports applications in human cells including targeted transcriptional activation, nuclease-mediated gene disruption, and cytidine and adenine base editing. Notably, despite its broadened PAM compatibility, xCas9 has much greater DNA specificity than SpCas9, with substantially lower genome-wide off-target activity at all NGG target sites tested, as well as minimal off-target activity when targeting genomic sites with non-NGG PAMs. These findings expand the DNA targeting scope of CRISPR systems and establish that there is no necessary trade-off between Cas9 editing efficiency, PAM compatibility and DNA specificity. Phage-assisted continuous evolution of Cas9 variants with broad PAM compatibility and high DNA specificity that can be used for transcriptional activation, gene disruption and base editing. CRISPR-mediated genome editing makes use of the Cas9 nuclease. However, the canonical Cas9 protein requires the presence of a specific sequence, NGG, to be able to recognize and cut target DNA. David Liu and colleagues developed a series of variant Cas9 proteins (xCas9) that have a broader sequence specificity. These proteins can function in several different contexts, including DNA base editing. One unanticipated property of these xCas9 proteins is that they display lower off-target activity than the canonical Cas9, despite their more numerous targets. The new Cas9 variants thus offer researchers options for a greater breadth of targeting in genome editing, without loss of specificity.