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.