Krüppel-like factor 4 (KLF4), a transcription factor, plays a key role in the pluripotency of stem cells. We sought to determine the function of KLF4 in T-cell development and differentiation by using T-cell-specific Klf4-knockout (KO) mice. We found that KLF4 was highly expressed in thymocytes and mature T cells and was rapidly down-regulated in mature T cells after activation. In Klf4-KO mice, we observed a modest reduction of thymocytes (27%) due to the reduced proliferation of double-negative (DN) thymocytes. We demonstrated that a direct repression of Cdkn1b by KLF4 was a cause of decreased DN proliferation. During in vitro T-cell differentiation, we observed significant reduction of IL-17-expressing CD4(+) T cells (Th17; 24%) but not in other types of Th differentiation. The reduction of Th17 cells resulted in a significant attenuation of the severity (35%) of experimental autoimmune encephalomyelitis in vivo in Klf4-KO mice as compared with the Klf4 wild-type littermates. Finally, we demonstrated that KLF4 directly binds to the promoter of Il17a and positively regulates its expression. In summary, these findings identify KLF4 as a critical regulator in T-cell development and Th17 differentiation.