Activator protein 1 (AP-1, also known as JUN) transcription factors are dimers of JUN, FOS, MAF and activating transcription factor (ATF) family proteins characterized by basic region and leucine zipper domains. Many AP-1 proteins contain defined transcriptional activation domains, but BATF and the closely related BATF3 (refs 2, 3) contain only a basic region and leucine zipper, and are considered to be inhibitors of AP-1 activity. Here we show that Batf is required for the differentiation of IL17-producing T helper (T(H)17) cells. T(H)17 cells comprise a CD4(+) T-cell subset that coordinates inflammatory responses in host defence but is pathogenic in autoimmunity. Batf(-/-) mice have normal T(H)1 and T(H)2 differentiation, but show a defect in T(H)17 differentiation, and are resistant to experimental autoimmune encephalomyelitis. Batf(-/-) T cells fail to induce known factors required for T(H)17 differentiation, such as RORgamma t (encoded by Rorc) and the cytokine IL21 (refs 14-17). Neither the addition of IL21 nor the overexpression of RORgamma t fully restores IL17 production in Batf(-/-) T cells. The Il17 promoter is BATF-responsive, and after T(H)17 differentiation, BATF binds conserved intergenic elements in the Il17a-Il17f locus and to the Il17, Il21 and Il22 (ref. 18) promoters. These results demonstrate that the AP-1 protein BATF has a critical role in T(H)17 differentiation.