Sensors of pathogens, such as Toll-like receptors (TLRs), detect microbes to activate transcriptional programs that orchestrate adaptive responses to specific insults. Here we report that TLR4 and TLR2 specifically activated the endoplasmic reticulum (ER) stress sensor kinase IRE1alpha and its downstream target, the transcription factor XBP1. Previously described ER-stress target genes of XBP1 were not induced by TLR signaling. Instead, TLR-activated XBP1 was required for optimal and sustained production of proinflammatory cytokines in macrophages. Consistent with that finding, activation of IRE1alpha by ER stress acted in synergy with TLR activation for cytokine production. Moreover, XBP1 deficiency resulted in a much greater bacterial burden in mice infected with the TLR2-activating human intracellular pathogen Francisella tularensis. Our findings identify an unsuspected critical function for XBP1 in mammalian host defenses.