The costimulatory requirements for Th17 development remain to be defined. In this study, we show that CD40-deficient animals immunized with the gram-positive bacterium Propionibacterium acnes were specifically impaired in their ability to mount an IL-17 response, but not that of IFN-gamma. The same cytokine imbalance resulted from in vivo priming with pathogen-pulsed, CD40-deficient dendritic cells (DC). Engagement of CD40 on P. acnes-conditioned DC stimulated the release of IL-12, IL-23, and IL-6, of which IL-6 alone proved essential for Th17 differentiation. Compared with wild-type DC, priming with those lacking expression of CD40 resulted in reduced disease severity during experimental autoimmune encephalomyelitis, coincident with reduced IL-17 production. Our data delineate sequential requirements for DC expression of CD40 and production of IL-6 during Th17 polarization in vitro and in vivo, and reveal distinct costimulatory requirements for Th1 vs Th17 generation.