When effective immune defenses against parasites are costly and resources limited, individuals are expected to alter their investment in immunity in response to the risk of infection. As an ecological factor that can affect both food abundance and parasite exposure, host density can play an important role in host immunity and host–parasite interactions. High levels of intraspecific competition for food and social stress at high host density may diminish immune defenses and increase host susceptibility to parasites. At the same time, for contagious and environmentally transmitted parasites, parasite exposure often increases with host density, whereas in mobile parasites that actively search for hosts, parasite exposure can decrease with host density due to the “encounter-dilution effect.” To unravel these multiple and potentially opposing effects of host density on immunity, we manipulated density of the common lizard Zootoca vivipara and measured local inflammation in response to PHA injection and levels of infestation by the tick Ixodes ricinus, a mobile ectoparasite for which we expected an encounter-dilution effect to occur. Local inflammation strongly decreased with lizard density in adults, but not in yearlings. Tick infestation (abundance and prevalence) was negatively correlated with lizard density in both age classes. Using path analyses, we found independent, direct negative density feedbacks on immunity and parasite exposure in adults, supporting the hypothesis of energy constraints and/or physiological stress acting on immunity at high density. In contrast, for yearlings, the best path model showed that density diluted exposure to parasites, which themselves down-regulated immune defenses in lizards. These results highlight the importance of investigating the pathways among host density, host immunity, and parasite infestation, while accounting for relevant individual traits such as age.