An analysis of DNA extracted from medieval victims and survivors of the Black Death shows that the monumental plague that ravaged Europe in the 14th century continues to impact our biology to this day.

Not just because the pathogen responsible is still active, but because the deadly, widespread pandemic triggered adaptations in our immune system that continued to evolve for hundreds of years.

The changes are not necessarily to our long-term benefit, either. Although the genes involved seem to have conferred increased resistance to the plague, scientists have found that those same genes today may be associated with increased susceptibility to autoimmune conditions, such as Crohn's disease and rheumatoid arthritis.

It's a finding that suggests pandemics may have unexpected, and sometimes deleterious, long-term effects that ripple down through the generations.

Peaking in the middle of the 1300s, the Black Death is widely regarded as one of the most devastating events in human history, claiming tens to hundreds of millions of lives across Europe, Asia, and Africa. It was caused by the Yersinia pestis bacterium and transmitted to humans via fleas to give rise to a disease that can be fatal within less than a day.

Such impactful infectious diseases represent one of the strongest pressures for natural selection, particularly for humans. Take sickle cell anemia for example, a genetic disorder that happens to also provide a degree of resistance against the more deadly malaria. Since someone with sickle cell is more likely to survive malaria, they'll have an opportunity to conceive more children who will also have sickle cell anemia. Over time, the incidence of sickle cell anemia rises within populations living in malaria-prone regions.

An international team of scientists led by geneticists Jennifer Klunk of McMaster University in Canada and Tauras Vilgalys of the University of Chicago wanted to see if they could ascertain how the Black Plague had altered the human genome.

"When a pandemic of this nature – killing 30 to 50 per cent of the population – occurs, there is bound to be selection for protective alleles in humans, which is to say people susceptible to the circulating pathogen will succumb," explains evolutionary geneticist Hendrik Poinar of McMaster University.

"Even a slight advantage means the difference between surviving or passing. Of course, those survivors who are of breeding age will pass on their genes."

Because the Black Plague was so widespread and the dead were buried in mass graves, there are a lot of bones for today's researchers to study. The scientists focused on a 100-year window before, during, and after the Black Plague. They obtained over 500 samples from individuals who died in London and Denmark, representing three groups: those who died before the plague (retrieved from a London mass grave), those who died during, and those who survived and died sometime later.

By comparing the genomes of these individuals, the researchers were able to identify four genes that were associated with the Black Death, selected for with a speed never seen either before or since in human history. Those genes produce proteins that help protect our bodies from invading pathogens, and individuals with one or more of these gene variants seemed to have been more likely to survive the plague.

To confirm what the ancient DNA seemed to imply, the researchers created cultures of human cells representing different genetic profiles and infected them with Yersinia pestis. Their results showed that the genes identified earlier in their study again appeared in the cultures most resistant against the bacterium.

In particular, individuals with two identical copies of a gene called ERAP2 were around 40 to 50 percent more likely to survive the plague than those with the opposite copies, which seem to have instead conferred increased susceptibility.

"The selective advantage associated with the selected loci are among the strongest ever reported in humans showing how a single pathogen can have such a strong impact on the evolution of the immune system," says geneticist Luis Barreiro of the University of Chicago.

As the centuries rolled on, the plague became less and less devastating, and humanity, largely, moved on. However, there was a big catch. Some of the gene variants identified by the researchers are today associated with an increased susceptibility to autoimmune diseases. Since the plague would have been the bigger evolutionary pressure back in the 1340s – like malaria and sickle cell anemia – this result was probably unavoidable.

This, the researchers say, provides empirical evidence for an association between autoimmune risk and adaptation to an infectious disease that spread centuries ago.

"Understanding the dynamics that have shaped the human immune system is key to understanding how past pandemics, like the plague, contribute to our susceptibility to disease in modern times," Poinar says.

The team's research has been published in Nature.