TRIM5 is a potent retrovirus inhibitor that targets viruses bearing particular capsid (CA) residues. In most primate species, retroviral restriction requires the C-terminal SPRY domain unique to the alpha-isoform of TRIM5, but the mechanism by which susceptible viruses are recognized and targeted for restriction is unknown. Here we show that TRIM5alpha binds retroviral CA from detergent-stripped virions in a SPRY-dependent manner with sufficient discrimination to account for the exquisite specificity of restriction.