The findings stemmed from research involving ancient DNA sequenced from 1,664 people from various sites across Western Europe and Asia. These ancient genomes were then compared with modern DNA from the UK Biobank, comprising about 410,000 self-identified "white-British" people, and more than 24,000 others born outside the United Kingdom, to discern changes over time.

One striking discovery related to MS, a chronic disease of the brain and spinal cord that is considered an autoimmune disorder in which the body mistakenly attacks itself.

The researchers identified a pivotal migration event about 5,000 years ago at the start of the Bronze Age when livestock herders called the Yamnaya people moved into Western Europe from an area that includes modern Ukraine and southern Russia.

They carried genetic traits that at the time were beneficial, protective against infections that could arise from their sheep and cattle. As sanitary conditions improved over the millennia, these same variants increased MS risk. This helps explain, the researchers said, why Northern Europeans have the world's highest MS prevalence, double that of Southern Europeans.

"We are a product of the evolution that happened in past environments, and in many ways we are not optimally adapted to the environment we have created for ourselves today," said University of California, Berkeley population geneticist Rasmus Nielsen, one of the leaders of the research published on Wednesday in the journal Nature.

Around 11,000 years ago, farmers from the area of modern Turkey expanded into Western Europe, replacing hunter-gatherers. It was these agriculturalists who the Yamnaya later replaced.

"The Yamnaya were Europe's first true nomads. They used domesticated cattle and horses to access the interiors of the Asian Steppe, where there is little to eat or drink, so carried everything with them on wagons. Physically they were unusually large, which we can see by measuring the skeletons and also genetically, and apparently fairly violent," University of Cambridge geneticist and study co-author William Barrie said.

"We think that much of the replacement that happened involved warfare," Nielsen added.

High Yamnaya-related ancestry exists in Northern Europeans, peaking in Ireland, Iceland, Norway and Sweden and decreasing further south.

The findings underscore how genetic traits can change from beneficial to deleterious as conditions evolve.

"Pathogenic infections increased in frequency during the Bronze Age, due to close proximity between people and their domestic animals, as well as rising population density," University of Copenhagen computational evolutionary biology specialist and research co-author Evan Irving-Pease said.

"It was not until the modern era, with widespread sanitation and medical care, that these genetic variants became surplus to our immunological requirements, resulting in an increase in the risk of developing MS and other autoimmune diseases," Irving-Pease added.

The findings may carry implications for MS research and treatment.

"This changes our view of MS, helping us understand its origins. We can see MS as the result of an immune system which has efficiently evolved to cope with a range of infections in the human past but which now exists in a very different environment. This difference between the past and modern sanitary environments likely causes the overactive immune system. This implies we should be aiming to recalibrate the immune system rather than suppress it," Barrie said.

The research shed light on other characteristics of Europeans.

Because the Yamnaya were genetically predisposed to being tall, present-day Northern Europeans tend to be taller than Southern Europeans, who have greater ancestry from Neolithic farmers who were genetically predisposed to being short.

Eastern Europeans have a heightened genetic risk for Alzheimer's and type 2 diabetes, the researchers found. They also discovered that lactose tolerance, the ability to digest the sugar in milk and other dairy products, emerged in Europe approximately 6,000 years ago.

(Reporting by Will Dunham in Washington, Editing by Rosalba O'Brien)

By Will Dunham