The human leukocyte antigens HLA-B27 and HLA-B57 are associated with protection against progression of disease that results from infection with human immunodeficiency virus type 1 (HIV-1), yet most people with alleles encoding HLA-B27 and HLA-B57 are unable to control HIV-1. Here we found that HLA-B27-restricted CD8(+) T cells in people able to control infection with HIV-1 (controllers) and those who progress to disease after infection with HIV-1 (progressors) differed in their ability to inhibit viral replication through targeting of the immunodominant epitope of group-associated antigen (Gag) of HIV-1. This was associated with distinct T cell antigen receptor (TCR) clonotypes, characterized by superior control of HIV-1 replication in vitro, greater cross-reactivity to epitope variants and enhanced loading and delivery of perforin. We also observed clonotype-specific differences in antiviral efficacy for an immunodominant HLA-B57-restricted response in controllers and progressors. Thus, the efficacy of such so-called 'protective alleles' is modulated by specific TCR clonotypes selected during natural infection, which provides a functional explanation for divergent HIV-1 outcomes.