The mechanisms of HLA-DM-catalyzed peptide exchange remain uncertain. Here we found that all stages of the interaction of HLA-DM with HLA-DR were dependent on the occupancy state of the peptide-binding groove. High-affinity peptides were protected from removal by HLA-DM through two mechanisms: peptide binding induced the dissociation of a long-lived complex of empty HLA-DR and HLA-DM, and high-affinity HLA-DR-peptide complexes bound HLA-DM only very slowly. Nonbinding covalent HLA-DR-peptide complexes were converted into efficient HLA-DM binders after truncation of an N-terminal peptide segment that emptied the P1 pocket and disrupted conserved hydrogen bonds to HLA-DR. HLA-DM thus binds only to HLA-DR conformers in which a critical part of the binding site is already vacant because of spontaneous peptide motion.