Leprosy, a chronic infectious disease caused by Mycobacterium leprae (M. leprae), was very common in Europe till the 16th century. Here, we perform an ancient DNA study on medieval skeletons from Denmark that show lesions specific for lepromatous leprosy (LL). First, we test the remains for M. leprae DNA to confirm the infection status of the individuals and to assess the bacterial diversity. We assemble 10 complete M. leprae genomes that all differ from each other. Second, we evaluate whether the human leukocyte antigen allele DRB1*15:01, a strong LL susceptibility factor in modern populations, also predisposed medieval Europeans to the disease. The comparison of genotype data from 69 M. leprae DNA-positive LL cases with those from contemporary and medieval controls reveals a statistically significant association in both instances. In addition, we observe that DRB1*15:01 co-occurs with DQB1*06:02 on a haplotype that is a strong risk factor for inflammatory diseases today.