At its peak, the sixth-century Justinian plague is said to have killed some 5,000 people in the Byzantine capital of Constantinople each day. According to historians, rats carrying plague-infested fleas likely brought the disease to Constantinople from Egypt aboard ships importing grain. The plague’s devastation, which played out over three centuries as subsequent waves of the disease grew less and less virulent, likely contributed to the downfall of the powerful Eastern Roman Empire by making it vulnerable to attacks from Muslim armies.

More than half a century later, a similar pandemic ravaged the population of Western Europe. During the 1340s, the infamous Black Death, or bubonic plague, killed as many as 20 million people. Its victims suffered some of the same symptoms the Roman historian Procopius had described when writing about the earlier plague: fevers, delirium and mysterious black swellings in the groin, under the arms and behind the ears.

Though the impact of the Justinian plague was clearly on the same scale as that of the Black Death, researchers have long been unable to clearly identify what type of plague it was. But in a groundbreaking new study, a team of German scientists used in-depth analysis of skeletons found in a sixth-century German cemetery to reconstruct the genome of the pathogen that caused the Justinian plague. They found that the microbe responsible for those 50 million deaths in the Byzantine Empire was Yersinia pestis (Y. pestis), the same bacterium that caused the Black Death.

The two skeletons used in the new study, which was published in the journal Molecular Biology and Evolution, were exhumed a half-century ago from Altenerding, a plague burial site located in southern Germany, near Munich. The researchers were able to use a single tooth from one of the skeletons—that of a woman between the age of 25 and 30—to extract the specimen of Y. pestis that they used to reconstruct the pathogen’s genome.

According to one of the study’s co-authors, Michaela Harbeck, the skeleton in question was found just kilometers from the skeletons analyzed by a team led by Dave Wagner, a microbial geneticist at Northern Arizona University, in an earlier study. Wagner’s research linked Y. pestis to both the Justinian plague and the Black Death, based on analysis of the teeth of two German victims killed by the plague around 1,500 years ago. Harbeck and her colleagues confirmed this link, but concluded that the Black Death wasn’t directly descended from the earlier plague; instead, it was caused by a genetically different strain of Y. pestis.

For the new study, the researchers completely reconstructed the genome behind the Justinian plague, including 30 newly identified mutations and structural rearrangements that occurred as DNA cells split apart and replicated themselves. Data from their reconstruction also suggested the particular Y. pestis strain behind the earlier plague was more genetically diverse than previously thought.

“Our research confirms that the Justinianic plague reached far beyond the historically documented affected region and provides new insights into the evolutionary history of Yersinia pestis,” Harbeck’s co-author Michal Feldman said in a statement.

The scientists hope their work will lend insight into the evolution, adaptation and impact of plague, which has affected mankind for some 5,000 years and continues to do so today in some regions around the world. Outbreaks in recent years have surfaced in Madagascar, the Democratic Republic of Congo and Peru. According to the World Health Organization, 320 cases of plague were reported worldwide in 2015, including 77 deaths.