Thymic epithelial cells (TEC) control T cell development and play essential roles in establishing self-tolerance. By using Foxn1-Cre-driven ablation of Klf6 gene in TEC, we identified Klf6 as a critical factor in TEC development. Klf6 deficiency resulted in a hypoplastic thymus-evident from fetal stages into adulthood-in which a dramatic increase in the frequency of apoptotic TEC was observed. Among cortical TEC (cTEC), a previously unreported cTEC population expressing the transcription factor Sox10 was relatively expanded. Within medullary TEC (mTEC), mTEC I and Tuft-like mTEC IV were disproportionately decreased. Klf6 deficiency altered chromatin accessibility and affected TEC chromatin configuration. Consistent with these defects, naïve conventional T cells and invariant natural killer T cells were reduced in the spleen. Late stages of T cell receptor-dependent selection of thymocytes were affected, and mice exhibited autoimmunity. Thus, Klf6 has a prosurvival role and affects the development of specific TEC subsets contributing to thymic function.