The peptide spanning residues 48-62 of hen egg white lysozyme presented by I-A(k) molecules gives rise to two T cell populations, types A and B, that recognize distinct conformers of the complex generated in late and recycling endosomes. The class II-like accessory molecule H2-DM functions as a conformational editor, eliminating the type B conformer in late endosomes. Here, we show that the conformation of the complex, and its susceptibility to editing by H2-DM, are determined by peptide amino-terminal flanking residues. Elimination of these residues abolished editing, permitting formation of the type B conformer in late endosomes. Substitutions at P(-2) affected the stability of the type B conformer, preventing its formation and/or editing, without hindering peptide binding or formation of the type A conformer of the complex. We conclude that interactions involving amino-terminal flanking residues stabilize peptide-MHC conformers and confer resistance to editing by H2-DM, influencing the nature of the T cell repertoire.