HLA-DM acts as a molecular chaperone and rescues empty HLA-DR molecules at lysosomal pH.