Drosophila melanogaster is widely used to study immune system function in insects. However, little work has been done in D. melanogaster on the effect of temperature on the immune system. Here we describe experiments that demonstrate that cooler temperatures enhance survival after infection and alter expression of immune-related genes in flies. This effect appears to be due not only to the fact that colder temperatures slow down bacterial growth, but also to the beneficial effects of cooler temperature on immune function. We explore the possibility that heat shock proteins, and in particular, Hsp83, may improve immune function at cool temperatures. We have long known that temperature can alter immune responses against microbial pathogens in insects. The approach described here allows us to determine whether this effect is due primarily to temperature-specific effects on the host or on its pathogen. These results suggest that both may be important.