Dietary carotenoids have been shown to confer immunological benefits to some species of animals in which males also use these pigments to attract mates. Thus, the potential exists for an allocation trade-off between the sexual and immunological functions of carotenoids. Food availability may also influence immune system function. The present study examined the effects of carotenoid and food availability on the resistance of male guppies (Poecilia reticulata Peters) from four wild populations to the parasite Gyrodactylus turnbulli Harris. Intermediate levels of carotenoid ingestion resulted in the lowest parasite loads, which suggests that carotenoids strengthen parasite resistance at low levels but either benefit parasites or suppress host immunity at high levels. Males raised on the high-food level initially had fewer parasites, suggesting heightened innate immunity relative to males raised on the low-food level. Over the course of the experiment, however, the high-food males supported higher parasite population growth rates than the low-food males. The results obtained emphasize the importance of evaluating the effects of diet on multiple aspects of immune system function, and caution against assuming that positive effects of carotenoids on immunity in one context will automatically translate to other contexts. © 2006 The Linnean Society of London, Biological Journal of the Linnean Society, 2006, 89, 301–309.