Parasite-mediated selection is potentially of great importance in modulating genetic diversity. Genetic variation for resistance, the fuel for natural selection, appears to be common in host-parasite interactions, but responses to selection are rarely observed. In the present study, we tested whether environmental variation could mediate infection and determine evolutionary outcomes. Temperature was shown to dramatically alter the potential for parasite-mediated selection in two independent laboratory infection experiments at four temperatures. The bacterial parasite, Pasteuria ramosa, was extremely virulent at 20 degrees C and 25 degrees C, sterilizing its host, Daphnia magna, so that females often never produced a single brood. However, at 10 degrees C and 15 degrees C, the host-parasite interaction was much more benign, as nearly all females produced broods before becoming sterile. This association between virulence and temperature alone could stabilize coexistence and lead to the maintenance of diversity, because it would weaken parasite-mediated selection during parts of the season. Additionally, highly significant genotype-by-environment interactions were found, with changes in clone rank order for infection rates at different temperatures. Our results clearly show that the outcome of parasite-mediated selection in this system is strongly context dependent.