In this study we investigate whether present-day variation in a key component of the immune system (baseline leucocyte concentrations) represents evolutionary adaptation to ecological factors. In particular, we test three hypotheses, namely that leucocyte concentrations will be positively related to one of the following: risk of disease transmission between hosts, which is related to host abundance (hypothesis 1), risk of disease infection from the environment due to parasite viability and abundance (hypothesis 2), and risk of injury and subsequent infection, for example following attacks by predators (hypothesis 3). No support was found for hypothesis 1: neither population density nor group size were associated with variation in leucocyte concentrations. Hypothesis 2 was supported: for both sexes, lymphocyte and phagocyte concentrations were positively correlated with annual rainfall, as predicted if interspecific variation in the immune system is related to parasite prevalence (primates suffer higher rates of parasitism in wetter habitats). Support was also provided for hypothesis 3: for both males and females, platelet concentrations were negatively related to body mass, as predicted if injury risk affects immune system evolution, because animals with larger body mass have a relatively lower surface area available to injury. Additional support was provided for hypothesis 3 by the finding that for males, the sex which plays the active role in troop defence and retaliation against predators, concentration of platelets was positively correlated with rate of predation. In conclusion, our analysis suggests that the risk of disease infection from the environment and the risk of injury have played a key role in immune system evolution among anthropoid primates.