The immune system should constitute a strong selective pressure promoting viral genetic diversity and evolution. However, HIV shows lower sequence variability at T-cell epitopes than elsewhere in the genome, in contrast with other human RNA viruses. Here, we propose that epitope conservation is a consequence of the particular interactions established between HIV and the immune system. On one hand, epitope recognition triggers an anti-HIV response mediated by cytotoxic T-lymphocytes (CTLs), but on the other hand, activation of CD4(+) helper T lymphocytes (TH cells) promotes HIV replication. Mathematical modeling of these opposite selective forces revealed that selection at the intrapatient level can promote either T-cell epitope conservation or escape. We predict greater conservation for epitopes contributing significantly to total immune activation levels (immunodominance), and when TH cell infection is concomitant to epitope recognition (trans-infection). We suggest that HIV-driven immune activation in the lymph nodes during the chronic stage of the disease may offer a favorable scenario for epitope conservation. Our results also support the view that some pathogens draw benefits from the immune response and suggest that vaccination strategies based on conserved TH epitopes may be counterproductive.