Clustered regularly interspaced short palindromic repeats (CRISPRs) and CRISPR-associated (Cas) proteins provide adaptive immunity to prokaryotes against invading phages and plasmids. As a countermeasure, phages have evolved anti-CRISPR (Acr) proteins that neutralize the CRISPR immunity. AcrIIA5, isolated from a virulent phage of Streptococcus thermophilus, strongly inhibits diverse Cas9 homologs, but the molecular mechanism underlying the Cas9 inhibition remains unknown. Here, we report the solution structure of AcrIIA5, which features a novel α/β fold connected to an N-terminal intrinsically disordered region (IDR). Remarkably, truncation of the N-terminal IDR abrogates the inhibitory activity against Cas9, revealing that the IDR is essential for Cas9 inhibition by AcrIIA5. Progressive truncations and mutations of the IDR illustrate that the disordered region not only modulates the association between AcrIIA5 and Cas9–sgRNA, but also alters the catalytic efficiency of the inhibitory complex. The length of IDR is critical for the Cas9–sgRNA recognition by AcrIIA5, whereas the charge content of IDR dictates the inhibitory activity. Conformational plasticity of IDR may be linked to the broad-spectrum inhibition of Cas9 homologs by AcrIIA5. Identification of the IDR as the main determinant for Cas9 inhibition expands the inventory of phage anti-CRISPR mechanisms.