Immune homeostasis is a prerequisite to protective immunity against gastrointestinal infections. In Drosophila, immune deficiency (IMD) signalling (tumour necrosis factor receptor/interleukin-1 receptor, TNFR/IL-1R in mammals) is indispensable for intestinal immunity against invading bacteria. However, how this local antimicrobial immune response contributes to inflammatory regulation remains poorly defined. Here, we show that flies lacking intestinal Bap180 (a subunit of the chromatin-remodelling switch/sucrose non-fermentable (SWI/SNF) complex) are susceptible to infection as a result of hyper-inflammation rather than bacterial overload. Detailed analysis shows that Bap180 is induced by the IMD-Relish response to both enteropathogenic and commensal bacteria. Upregulated Bap180 can feed back to restrain overreactive IMD signalling, as well as to repress the expression of the pro-inflammatory gene eiger (TNF), a critical step to prevent excessive tissue damage and elongate the lifespan of flies, under pathological and physiological conditions, respectively. Furthermore, intestinal targeting of Baf180 renders mice susceptible to a more aggressive infectious colitis caused by Citrobacter rodentium. Together, Bap180 and Baf180 serve as a conserved transcriptional repressor that is critical for the maintenance of innate immune homeostasis in the intestines.