Interleukin (IL)-17-producing CD4 T cells ('Th17 cells') are most abundant at the intestinal mucosa, and play a critical role in the maintenance of mucosal barrier function. Recent studies indicate that accumulation of intestinal Th17 cells depends on stimulation by intestinal commensal bacteria - particularly by segmented filamentous bacterium. In this review, we summarise recent advances in our understanding of the mechanisms of intestinal Th17 synthesis in mice, and discuss their relevance to infectious and inflammatory diseases.