Many Europeans carry genetic mutations that protected their ancestors from the bubonic plague, scientists reported Wednesday in the journal Nature.

When the Black Death struck Europe in 1348, the bacterial infection killed large swaths of people across the continent, driving the strongest pulse of natural selection yet measured in humans, the new study found.

It turns out that certain genetic variants made people far more likely to survive the plague. But this protection came with a price: People who inherit the plague-resistant mutations run a higher risk of immune disorders such as Crohn’s disease.