A key limitation to the use of CRISPR-Cas9 proteins 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 shown to function efficiently in mammalian cells offer a PAM less restrictive than NGG. Here we used phage-assisted continuous evolution (PACE) 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 date among Cas9s active in mammalian cells, and supports applications in human cells including targeted transcriptional activation, nuclease-mediated gene disruption, and both cytidine and adenine base editing. Remarkably, 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.