The bacterium Yersinia pestis has inflicted almost unimaginable misery upon humankind over the centuries, killing an estimated 200 million or more people and triggering horrific plagues in the 6th and 14th centuries.

But this germ was not always particularly dangerous. Scientists said on Tuesday minor genetic changes that it underwent many centuries ago - adding a single gene that subsequently mutated - turned it from mild to murderous.

Yersinia pestis caused two of the deadliest pandemics in human history: the 6th century Justinian Plague, named for the Byzantine emperor who was sickened but survived, and the 14th century Black Death. Rats with fleas carrying the germ spread the plague to people.

The researchers conducted mouse experiments that retraced the fateful genetic change in the bacterium.

They took an ancestral form of the bacterium that still circulates in the wild - isolated in a rodent called a vole from Asia - and inserted into it a gene called Pla, which is involved in breaking down blood clots. This addition empowered the bacterium to produce a fatal lung infection.

The addition of the gene long ago transformed Yersinia pestis from a pathogen that caused a mild gastrointestinal infection to one that caused the fatal respiratory disease called pneumonic plague.

They also found that a single mutation of the same gene - a mutation present in modern strains of the bacterium - enabled it to spread in the body and invade the lymph nodes as occurs in bubonic plague.

The Justinian Plague is estimated to have killed 25 million to 50 million people and the Black Death at least 150 million people, said microbiologist Wyndham Lathem of Northwestern University's Feinberg School of Medicine in Chicago, who led the study published in the journal Nature Communications.

"It's just remarkable what Yersinia pestis has done to the course of human civilization," Lathem said.

He said it is hard to know with certainty when the bacterium, which has gained and lost various genes over time, added the Pla gene, but "it's certainly likely to have occurred at least more than 1,500 years ago." That would mean it could have occurred in the century before the Justinian Plague.

"That's something to keep in mind when we're studying other bacterial pathogens," Lathem added. "A small change is all that's needed and suddenly we may be faced with a new pandemic of some sort."