In 2004, the first report of TRIM5α as a cellular antiretroviral factor triggered intense interest among virologists, particularly because some primate orthologs of TRIM5α have activity against HIV. Since that time, a complex and eventful evolutionary history of the TRIM5 locus has emerged. A review of the TRIM5 literature constitutes a veritable compendium of evolutionary phenomena, including elevated rates of nonsynonymous substitution, divergence in subdomains due to short insertions and deletions, expansions and contractions in gene copy number, pseudogenization, balanced polymorphism, trans-species polymorphism, convergent evolution, and the acquisition of new domains by exon capture. Unlike most genes, whose history is dominated by long periods of purifying selection interspersed with rare instances of genetic innovation, analysis of restriction factor loci is likely to be complicated by the unpredictable and more-orless constant influence of positive selection. In this regard, the molecular evolution and population genetics of restriction factor loci most closely resemble patterns that have been documented for immunity genes, such as class I and II MHC genes, whose products interact directly with microbial targets. While the antiretroviral activity encoded by TRIM5 provides plausible mechanistic hypotheses for these unusual evolutionary observations, evolutionary analyses have reciprocated by providing significant insights into the structure and function of the TRIM5α protein. Many of the lessons learned from TRIM5 should be applicable to the study of other restriction factor loci, and molecular evolutionary analysis could facilitate the discovery of new antiviral factors, particularly among the many TRIM genes whose functions remain as yet unidentified.