Accumulating evidence indicates that mitochondria play crucial roles in immunity. However, the role of the mitochondrial Krebs cycle in immunity remains largely unknown, in particular at the organism level. Here we show that mitochondrial aconitase, ACO-2, a Krebs cycle enzyme that catalyzes the conversion of citrate to isocitrate, inhibits immunity against pathogenic bacteria inC. elegans. We find that the genetic inhibition ofaco-2decreases the level of oxaloacetate. This increases the mitochondrial unfolded protein response, subsequently upregulating the transcription factor ATFS-1, which contributes to enhanced immunity against pathogenic bacteria. We show that the genetic inhibition of mammalianACO2increases immunity against pathogenic bacteria by modulating the mitochondrial unfolded protein response and oxaloacetate levels in cultured cells. Because mitochondrial aconitase is highly conserved across phyla, a therapeutic strategy targeting ACO2 may eventually help properly control immunity in humans.