IL-7 is a cytokine essential for T cell development and survival. However, the local function of IL-7 produced by thymic epithelial cells (TECs) is poorly understood. To address this question, we generated IL-7-floxed mice and crossed them with FoxN1 promoter-driven Cre (FoxN1-Cre) mice to establish knockout mice conditionally deficient for the expression of IL-7 by TECs. We found that αβ and γδ T cells were significantly reduced in the thymus of IL-7(f/f) FoxN1-Cre mice. Proportion of mature single-positive thymocytes was increased. In lymph nodes and the spleen, the numbers of T cells were partially restored in IL-7(f/f) FoxN1-Cre mice. In addition, γδ T cells were absent from the fetal thymus and epidermis of IL-7(f/f) FoxN1-Cre mice. Furthermore, TCRγδ(+) intraepithelial lymphocytes (IELs) were significantly decreased in the small intestines of IL-7(f/f) FoxN1-Cre mice. To evaluate the function of IL-7 produced in the intestine, we crossed the IL-7(f/f) mice with villin promoter-driven Cre (Vil-Cre) mice to obtain the mice deficient in IL-7 production from intestinal epithelial cells. We observed that αβ and γδ IELs of IL-7(f/f) Vil-Cre mice were comparable to control mice. Collectively, our results suggest that TEC-derived IL-7 plays a major role in proliferation, survival, and maturation of thymocytes and is indispensable for γδ T cell development. This study also demonstrates that IL-7 produced in the thymus is essential for the development of γδ IELs and indicates the thymic origin of γδ IELs.