Human leukocyte antigen (HLA)-B27-positive subjects are uncommon in their ability to control infection with human immunodeficiency virus type 1 (HIV-1). However, late viral escape from a narrowly directed immunodominant Gag-specific CD8(+) T-lymphocyte (CTL) response has been linked to AIDS progression in these individuals. Identifying the mechanism of the immune-mediated control may provide critical insights into HIV-1 vaccine development. Here, we illustrate that the CTL escape mutation R(264)K in the HLA-B27-restricted KK10 epitope in the capsid resulted in a significant defect in viral replication in vitro. The R(264)K variant was impaired in generating late reverse transcription products, indicating that replication was blocked at a postentry step. Notably, the R(264)K mutation was associated in vivo with the development of a rare secondary mutation, S(173)A, which restored viral replication in vitro. Furthermore, infectivity of the R(264)K variant was rescued by the addition of cyclosporine A or infection of a cyclophilin A-deficient cell line. These data demonstrate a severe functional defect imposed by the R(264)K mutation during an early step in viral replication that is likely due to the inability of this variant to replicate efficiently in the presence of normal levels of cyclophilin A. We conclude that the impact of the R(264)K substitution on capsid structure constrains viral escape and enables long-term maintenance of the dominant CTL response against B27-KK10, providing an explanation for the protective effect of HLA-B27 during HIV infection.