For thousands of years, the Iberian Peninsula — home now to Spain and Portugal — has served as a crossroads.

Phoenicians from the Near East built trading ports there 3,000 years ago, and Romans conquered the region around 200 B.C. Muslim armies sailed from North Africa and took control of Iberia in the 8th century A.D. Some three centuries later, they began losing territory to Christian states.

Along with historical records and archaeological digs, researchers now have a new lens on Iberia’s past: DNA preserved in the region’s ancient skeletons. Archaeologists and geneticists are extracting genetic material spanning not just Iberia’s written history but its prehistory, too.

“We wanted to bridge the ancient populations and the modern populations,” said Iñigo Olalde, a geneticist at Harvard Medical School. Dr. Olalde is the lead author of a paper published on Thursday in Science that analyzes the DNA of 271 ancient Iberians.