Recently, a positive correlation between basal leukocyte counts and mating system across primates suggested that sexual promiscuity could be an important determinant of the evolution of the immune system. Motivated by this idea, we examined the patterns of molecular evolution of 15 immune defense genes in primates in relation to promiscuity and other variables expected to affect disease risk. We obtained maximum likelihood estimates of the rate of protein evolution for terminal branches of the primate phylogeny at these genes. Using phylogenetically independent contrasts, we found that immunity genes evolve faster in more promiscuous species, but only for a subset of genes that interact closely with pathogens. We also observed a significantly greater proportion of branches under positive selection in the more promiscuous species. Analyses of independent contrasts also showed a positive effect of group size. However, this effect was not restricted to genes that interact closely with pathogens, and no differences were observed in the proportion of branches under positive selection in species with small and large groups. Together, these results suggest that mating system has influenced the evolution of some immunity genes in primates, possibly due to increased risk of acquiring sexually transmitted diseases in species with higher levels of promiscuity.