The extent and pattern of HLA class II sequence polymorphism raise a variety of evolutionary questions, notably those concerning the genetic mechanisms for generating diversity, the rate of change and the nature of the selection pressure maintaining this variation. Phylogenetic analysis of primate MHC class II sequences suggests that the allelic lineages are ancient, having diverged long before separation of the hominoid species. For the beta-chain loci, however, considerable allelic diversification within these lineages has occurred after speciation. The striking patchwork pattern of polymorphism with different alleles containing common sequence motifs can be accounted for by common ancestry, by gene conversion or by convergent evolution, depending on the location of the shared epitope.