T helper 17 (Th17)‐cell differentiation triggered by interleukin‐6 (IL‐6) via STAT3 activation promotes inflammation in inflammatory bowel disease (IBD) patients. However, leukemia inhibitory factor (LIF), an IL‐6 family cytokine, restricts inflammation by blocking Th17‐cell differentiation via an unknown mechanism. Here, we report that microbiota dysregulation promotes LIF secretion by intestinal epithelial cells (IECs) in a mouse colitis model. LIF greatly activates STAT4 phosphorylation on multiple SPXX elements within the C‐terminal transcription regulation domain. STAT4 and STAT3 act reciprocally on both canonical cis‐inducible elements (SIEs) and noncanonical “AGG” elements at different loci. In lamina propria lymphocytes (LPLs), STAT4 activation by LIF blocks STAT3‐dependent Il17a/Il17f promoter activation, whereas in IECs, LIF bypasses the extraordinarily low level of STAT4 to induce YAP gene expression via STAT3 activation. In addition, we found that the administration of LIF is sufficient to restore microbiome homeostasis. Thus, LIF effectively inhibits Th17 accumulation and promotes repair of damaged intestinal epithelium in inflamed colon, serves as a potential therapy for IBD.