People who survived the Black Death were healthier and lived longer than the previous generations, a new study has found.

The research shows that the Bubonic plague, which killed 25 million people in Europe during the Middle Ages, led to better living conditions for survivors and shaped the demographics of the region.

University of South Carolina anthropologist Sharon DeWitte led the latest research on plague. Analysis of skeletal remains showed that people who lived after the plague had lower risk of dying at any age when compared to people who lived before the epidemic.

The plaque was caused by the bacteria Yersinia pestis. Some estimates suggest that nearly half of all Londoners died during the first wave of the disease from 1347 to 1351. The epidemic led to the rise of living standards, which meant that the post-epidemic London had a healthier population than pre-plague population.

 "Knowing how strongly diseases can actually shape human biology can give us tools to work with in the future to understand disease and how it might affect us," Sharon DeWitte said in a news release.

For the study, she analyzed bones of over 1,000 men, women and children who lived before or after the Black Death. The skeletal remains were housed in the Museum of London.

The research also showed that the plague didn't kill people randomly, but chose frail people as its victims. Survivors also had a longer life expectancy than the previous generation.

DeWitte said that she was surprised by the difference in health outcomes before and after the plaque struck Europe.

"The Black Death was just the first outbreak of medieval plague, so the post-Black Death population suffered major threats to health in part from repeated outbreaks of plague," DeWitte said. "Despite this, I found substantial improvements in demographics and thus health following the Black Death."

The study is published in the journal PLOS One.