Gut homeostasis is controlled by both immune and developmental mechanisms, and its disruption can lead to inflammatory disorders or cancerous lesions of the intestine. While the impact of bacteria on the mucosal immune system is beginning to be precisely understood, little is known about the effects of bacteria on gut epithelium renewal. Here, we addressed how both infectious and indigenous bacteria modulate stem cell activity in Drosophila. We show that the increased epithelium renewal observed upon some bacterial infections is a consequence of the oxidative burst, a major defense of the Drosophila gut. Additionally, we provide evidence that the JAK-STAT (Janus kinase-signal transducers and activators of transcription) and JNK (c-Jun NH(2) terminal kinase) pathways are both required for bacteria-induced stem cell proliferation. Similarly, we demonstrate that indigenous gut microbiota activate the same, albeit reduced, program at basal levels. Altered control of gut microbiota in immune-deficient or aged flies correlates with increased epithelium renewal. Finally, we show that epithelium renewal is an essential component of Drosophila defense against oral bacterial infection. Altogether, these results indicate that gut homeostasis is achieved by a complex interregulation of the immune response, gut microbiota, and stem cell activity.