Lymphoid organs represent a specialized microenvironment for interaction of stromal and lymphoid cells. In primary lymphoid organs, these interactions are required to establish a self-tolerant repertoire of lymphocytes. While detailed information is available about the genes that control lymphocyte differentiation, little is known about the genes that direct the establishment and differentiation of principal components of such microenvironments. Here, we discuss genetic studies addressing the role of thymic epithelial cells (TECs) during thymopoiesis. We have identified an evolutionarily conserved key regulator of TEC differentiation, Foxn1, that is required for the immigration of prothymocytes into the thymic primordium. Because Foxn1 specifies the prospective endodermal domain that gives rise to thymic epithelial cells, it can be used to identify the evolutionary origins of this specialized cell type. In the course of these studies, we have found that early steps of thymus development in zebrafish are very similar to those in mice. Subsequently, we have used chemical mutagenesis to derive zebrafish lines with aberrant thymus development. Strengths and weaknesses of mouse and zebrafish models are largely complementary such that genetic analysis of mouse and zebrafish mutants may lead to a better understanding of thymus development.