Inflammatory CD4+ T cell responses to self or commensal bacteria underlie the pathogenesis of autoimmunity and inflammatory bowel disease (IBD), respectively. Although selection of self-specific T cells in the thymus limits responses to mammalian tissue antigens, the mechanisms that control selection of commensal bacteria-specific T cells remain poorly understood. Here, we demonstrate that group 3 innate lymphoid cell (ILC3)-intrinsic expression of major histocompatibility complex class II (MHCII) is regulated similarly to thymic epithelial cells and that MHCII+ ILC3s directly induce cell death of activated commensal bacteria-specific T cells. Further, MHCII on colonic ILC3s was reduced in pediatric IBD patients. Collectively, these results define a selection pathway for commensal bacteria-specific CD4+ T cells in the intestine and suggest that this process is dysregulated in human IBD.