A pool of immature T cells with a seemingly unrestricted repertoire of antigen specificities is generated life-long in the thymus. Amongst these cells are, however, thymocytes that express a strongly self-reactive antigen receptor and hence hold the potential to trigger autoimmunity. To prevent such an outcome, the thymus employs several independent but functionally related strategies that act in parallel to enforce self-tolerance. The deletion of strongly self-reactive thymocytes and the generation of regulatory T cells constitute the two most efficient mechanisms to induce and maintain immunological tolerance. Thymic epithelial cells of the medulla express for this purpose tissue-restricted self-antigens. This review will focus on the cellular and molecular mechanisms operative in the thymus to shape a repertoire of mature T cells tolerant to self-antigens.