Natural selection on polymorphic protein-coding loci of human immunodeficiency virus-1 (HIV-1), the more geographically widespread of the two viruses causing human acquired immune deficiency syndrome (AIDS), was studied by estimating the rates of nucleotide substitution per site in comparisons among alleles classified in families of related alleles on the basis of a phylogenetic analysis. In the case of gag, pol, and gp41, the rate of synonymous substitution generally exceeded that of nonsynonymous substitution, indicating that these genes are subject to purifying selection. However, in the case of several of the variable (V) regions of the gp120 gene, especially V2 and V3, comparisons within and between families often showed a significantly higher rate of nonsynonymous than of synonymous nucleotide substitution. This pattern of nucleotide substitution indicates that positive Darwinian selection has acted to diversify these regions at the amino acid level. The V regions have been identified as probable epitopes for antibody recognition; therefore, avoidance of such recognition seems likely to be the basis for positive selection on these regions. By contrast, regions of HIV-1 proteins identified as epitopes for T cell recognition show no evidence of positive selection and are often highly conserved at the amino acid level. These results suggest that selection favoring avoidance of T cell recognition has not been a major factor in the history of HIV-1 and thus that avoidance of T cell recognition is not likely to be a major factor in the pathogenesis of AIDS.