Microbiota-mediated effects on the host immune response facilitate colonization resistance against pathogens. However, it is unclear whether and how the host immune response can regulate the microbiota to mediate colonization resistance. ID2, an essential transcriptional regulator for the development of innate lymphoid cell (ILC) progenitors, remains highly expressed in differentiated ILCs with unknown function. Using conditionally deficient mice in which ID2 is deleted from differentiated ILC3s, we observed that these mutant mice exhibited greatly impaired gut colonization resistance against Citrobacter rodentium. Utilizing gnotobiotic hosts, we showed that the ID2-dependent early colonization resistance was mediated by interleukin-22 (IL-22) regulation of the microbiota. In addition to regulating development, ID2 maintained homeostasis of ILC3s and controlled IL-22 production through an aryl hydrocarbon receptor (AhR) and IL-23 receptor pathway. Thus, ILC3s can mediate immune surveillance, which constantly maintains a proper microbiota, to facilitate early colonization resistance through an ID2-dependent regulation of IL-22.