The occurrence and magnitude of disease outbreaks can strongly influence host evolution. In particular, when hosts face a resistance-fecundity trade-off, they might evolve increased resistance to infection during larger epidemics but increased susceptibility during smaller ones. We tested this theoretical prediction by using a zooplankton-yeast host-parasite system in which ecological factors determine epidemic size. Lakes with high productivity and low predation pressure had large yeast epidemics; during these outbreaks, hosts became more resistant to infection. However, with low productivity and high predation, epidemics remained small and hosts evolved increased susceptibility. Thus, by modulating disease outbreaks, ecological context (productivity and predation) shaped host evolution during epidemics. Consequently, anthropogenic alteration of productivity and predation might strongly influence both ecological and evolutionary outcomes of disease.