The immune response to HIV-1 in patients who carry human histocompatibility leukocyte antigen (HLA)-B27 is characterized by an immunodominant response to an epitope in p24 gag (amino acids 263-272, KRWIILGLNK). Substitution of lysine (K) or glycine (G) for arginine (R) at HIV-1 gag residue 264 (R264K and R264G) results in epitopes that bind to HLA-B27 poorly. We have detected a R264K mutation in four patients carrying HLA-B27. In three of these patients the mutation occurred late, coinciding with disease progression. In another it occurred within 1 yr of infection and was associated with a virus of syncytium-inducing phenotype. In each case, R264K was tightly associated with a leucine to methionine change at residue 268. After the loss of the cytotoxic T lymphocyte (CTL) response to this epitope and in the presence of high viral load, reversion to wild-type sequence was observed. In a fifth patient, a R264G mutation was detected when HIV-1 disease progressed. Its occurrence was associated with a glutamic acid to aspartic acid mutation at residue 260. Phylogenetic analyses indicated that these substitutions emerged under natural selection rather than by genetic drift or linkage. Outgrowth of CTL escape viruses required high viral loads and additional, possibly compensatory, mutations in the gag protein.