Intestinal infection triggers potent immune responses to combat pathogens and concomitantly drives epithelial renewal to maintain barrier integrity. Current models propose that epithelial renewal is primarily driven by damage caused by reactive oxygen species (ROS). Here we found that in Drosophila, the Imd-NF-κB pathway controlled enterocyte (EC) shedding upon infection, via a mechanism independent of ROS-associated apoptosis. Mechanistically, the Imd pathway synergized with JNK signaling to induce epithelial cell shedding specifically in the context of bacterial infection, requiring also the reduced expression of the transcription factor GATAe. Furthermore, cell-specific NF-κB responses enabled simultaneous production of antimicrobial peptides (AMPs) and epithelial shedding in different EC populations. Thus, the Imd-NF-κB pathway is central to the intestinal antibacterial response by mediating both AMP production and the maintenance of barrier integrity. Considering the similarities between Drosophila Imd signaling and mammalian TNFR pathway, our findings suggest the existence of an evolutionarily conserved genetic program in immunity-induced epithelial shedding.