Starting from the X-ray structure of a class I major histocompatibility complex (MHC)-encoded protein (HLA-B*2705), a naturally presented self-nonapeptide and two synthetic analogues were simulated in the binding groove of two human leukocyte antigen (HLA) alleles (B*2703 and B*2705) differing in a single amino acid residue. After 200 ps molecular dynamics simulations of the solvated HLA-peptide pairs, some molecular properties of the complexes (distances between ligand and protein center of masses, atomic fluctuations, buried versus accessible surface areas, hydrogen-bond frequencies) allow a clear discrimination of potent from weak MHC binders. The binding specificity of the three nonapeptides for the two HLA alleles could be explained by the disruption of one hydrogen-bonding network in the binding pocket of the HLA-B*2705 protein where the single mutation occurs. Rearrangements of interactions in the B pocket, which binds the side chain of peptide residue 2, and a weakening of interactions involving the C-terminal end of the peptide also took place. In addition, extension of the peptide backbone using a beta-Ala analogue did not abolish binding to any of the two HLA-B27 subtypes, but increased the selectivity for B*2703, as expected from the larger peptide binding groove in this subtype. A better understanding of the atomic details involved in peptide selection by closely related HLA alleles is of crucial importance for unraveling the molecular features linking particular HLA alleles to autoimmune diseases, and for the identification of antigenic peptides triggering such pathologies.