The inhabitants of ancient Rome genetically resembled the populations of the Eastern Mediterranean and Middle East at the height of its empire, according to a newly published DNA study.

The paper is based on genome data of 127 individuals from 29 archaeological sites in and around the city, spanning nearly 12,000 years of Roman prehistory and history.

Little genetic work had been carried out until now on ancient Rome and central Italy.

Writing in the journal Science, researchers from Stanford University and universities in Italy said people from the city’s earliest eras and from after the Western empire’s decline in the fourth century genetically resembled other Western Europeans.

But during the imperial period, Romans had more in common with populations from Greece, Syria and Lebanon.

The earliest sequenced genomes, from three individuals who lived 9,000 to 12,000 years ago, resembled other European hunter-gatherers at the time.

Starting from 9,000 years ago, the genetic makeup of Romans again changed in line with the rest of Europe following an influx of farmers from Anatolia or modern Turkey.

Things started to change from 900 to 200 B.C. as Rome grew in size and importance, but diversity then shot up from 27 B.C. to A.D. 300, when the city was the capital of an empire of 50 million to 90 million people stretching from North Africa to Britain and the Middle East.

Of the 48 individuals sampled from this period, only two showed strong genetic ties to Europe.

The genetic “diversity was just overwhelming,” added Ron Pinhasi of the University of Vienna, who extracted DNA from the skeletons’ ear bones.

After the empire split in two, with the eastern capital in Constantinople (now Istanbul), Rome’s diversity declined once more.

“The genetic information parallels what we know from historical and archaeological records,” said Kristina Killgrove, a Roman bioarchaeologist at the University of North Carolina at Chapel Hill who wasn’t involved in the study.

Jonathan Pritchard, a population geneticist at Stanford University who sequenced and analyzed the DNA, said mass migration is sometimes thought to be a new phenomenon.

“But it’s clear from ancient DNA that populations have been mixing at really high rates for a long time,” he added.