The bacterium that causes the Black Plague, called Yersinia pestis, has been infecting humans ever since it evolved 5,000 to 10,000 years ago. But its ancestor, Y. pseudotuberculosis, only causes an illness similar to scarlet fever. Most people recover from an Y. pseudotuberculosis infection after a few weeks. The Plague, of course, is far more deadly. Now, researchers have pinpointed two mutations that helped Y. pestis make the leap from a passing illness to a killer.

Y. pestis can cause three different types of plague — bubonic, which enters through the skin and causes lymph nodes to swell; pneumonic, which attacks the lungs; and septicemic, which infects the blood. Although all three can be deadly, pneumonic​ plague is rarer and the most serious form of the disease. Without treatment, the bacteria kills close to 100 percent of those infected, explain researchers Daniel Zimbler and Wyndham Lathem of Northwestern University at The Conversation. Along with their colleagues, these two were searching for how Y. pestis gained the ability to infect lungs.

DNA found in the remains of humans killed by the Black Death and buried in a mass grave in London provided clues. Another group’s analysis of that genetic material showed that the bacteria that killed twenty million people in 1348 to 1350 is very similar to modern strains of Y. pestis. So Zimbler, Wyndham and their team wanted to look further back, to figure out what pre-Black Death plague looked like. To do that, they decided to compare modern Y. pestis with a more ancestral strain carried by voles in highlands spanning the South Caucasus as well as Y. pseudotuberculosis.

The researchers tested different strains of the bacterium in mice to figure out which genes were most important for its virulance and deadliness, Sarah Schwartz reports for Science News.

Their comparison showed that there were two key mutations in the same gene that took the less-deadly bacteria, and turned it into the super-killer we know today. The first mutation gave the bacteria the ability to make a protein called Pla. Without Pla, Y. pestis couldn’t infect the lungs. The second mutation allowed the bacteria to enter deeper into the bodies, say through a bite, to infect blood and the lymphatic system. In other words, first the plague grew deadly, then it found a way to leap more easily from infected fleas or rodents to humans.

The researchers wrote up their findings in Nature Communications.

The time needed to acquire those mutations might explain why Y. pestis was around for so long before it caused a full blown crisis. The first pandemic on record is the Justinian Plague, which hit the Byzantine Empire in 541, thousands of years after the bacteria diverged from its relatively harmless ancestor. That outbreak killed an estimated 25 million people around the Mediterranean. Over the next centuries, Y. pestis would emerge again as the Black Death during the Middle Ages and again in the 19th and 20th centuries.

More plague strains still circulate among rodent populations around the world and in the future a mutation could cause an outbreak in humans again. Fortunately, better sanitation and faster treatments mean that plague today likely won’t kill as many as it once did.