Genetic variation in the major histocompatibility complex (MHC) affects CD4∶CD8 lineage commitment and MHC expression. However, the contribution of specific genes in this gene-dense region has not yet been resolved. Nor has it been established whether the same genes regulate MHC expression and T cell selection. Here, we assessed the impact of natural genetic variation on MHC expression and CD4∶CD8 lineage commitment using two genetic models in the rat. First, we mapped Quantitative Trait Loci (QTLs) associated with variation in MHC class I and II protein expression and the CD4∶CD8 T cell ratio in outbred Heterogeneous Stock rats. We identified 10 QTLs across the genome and found that QTLs for the individual traits colocalized within a region spanning the MHC. To identify the genes underlying these overlapping QTLs, we generated a large panel of MHC-recombinant congenic strains, and refined the QTLs to two adjacent intervals of ∼0.25 Mb in the MHC-I and II regions, respectively. An interaction between these intervals affected MHC class I expression as well as negative selection and lineage commitment of CD8 single-positive (SP) thymocytes. We mapped this effect to the transporter associated with antigen processing 2 (Tap2) in the MHC-II region and the classical MHC class I gene(s) (RT1-A) in the MHC-I region. This interaction was revealed by a recombination between RT1-A and Tap2, which occurred in 0.2% of the rats. Variants of Tap2 have previously been shown to influence the antigenicity of MHC class I molecules by altering the MHC class I ligandome. Our results show that a restricted peptide repertoire on MHC class I molecules leads to reduced negative selection of CD8SP cells. To our knowledge, this is the first study showing how a recombination between natural alleles of genes in the MHC influences lineage commitment of T cells.