A study of 41 monkey and ape species found that those which were naturally promiscuous had the largest number of white cells in their blood.
White cells are one of the body's first lines of defence against infectious diseases. Different types destroy or overpower invading bugs, or direct other elements of the immune system.
The discovery by Charles Nunn and colleagues at the University of Virginia, Charlottesville in the United States suggests that at least in some cases immune systems have evolved to protect primates from their own promiscuity.
However, the researchers found this did not apply to humans, whose low white blood cell counts are consistent with monogamy. Sexual habits vary greatly among different primates.
In gibbons, for example, females generally have just one partner. Barbary macaque females, on the other hand, may mate with up to 10 males a day.
The study was based on an analysis of blood samples taken from adult female primates in zoos.
White cell counts were found to be significantly higher in species, like the barbary macaque, where females have multiple mating partners.
Aside from sexual contact, disease risk is increased by transmission between members of a large group and exposure to dirt.
Reporting their findings in the journal Science, Nunn's team said: "The surprising result is that this variation appears to be driven by risk of acquiring sexually transmitted disease rather than disease that is transmitted as a function of social group size or terrestrial locomotion.
"The precise reason for this result requires further study." The scientists speculated that sexually transmitted diseases may be more common in nature than people realise, or unusually persistent and evasive.
(la/dpa)