Many bacteria use CRISPR–Cas systems to combat mobile genetic elements, such as bacteriophages and plasmids1. In turn, these invasive elements have evolved anti-CRISPR proteins to block host immunity2,3. Here we unveil a distinct type of CRISPR–Cas Inhibition strategy that is based on small non-coding RNA anti-CRISPRs (Racrs). Racrs mimic the repeats found in CRISPR arrays and are encoded in viral genomes as solitary repeat units4. We show that a prophage-encoded Racr strongly inhibits the type I-F CRISPR–Cas system by interacting specifically with Cas6f and Cas7f, resulting in the formation of an aberrant Cas subcomplex. We identified Racr candidates for almost all CRISPR–Cas types encoded by a diverse range of viruses and plasmids, often in the genetic context of other anti-CRISPR genes5. Functional testing of nine candidates spanning the two CRISPR–Cas classes confirmed their strong immune inhibitory function. Our results demonstrate that molecular mimicry of CRISPR repeats is a widespread anti-CRISPR strategy, which opens the door to potential biotechnological applications6.