Genetic samples collected from across the United Kingdom are shedding light on the ancient past, including Viking invasions and a mystery about the arrival of the Anglo-Saxons, researchers report.

The DNA also suggests that, genetically speaking, people in Wales are the closest matches to early settlers of Britain after the last ice age, people who began showing up some 10,000 to 11,000 years ago. That’s because the Welsh genetic material has been the least affected by later migrations, said Peter Donnelly of Oxford University, a key author.

The work was presented in a paper released by the journal Nature. The researchers studied DNA samples from 2,039 white residents of Britain and Northern Ireland.

To identify signs of ancient immigrations, the researchers consulted DNA samples taken from continental Europeans.

Analysis showed that Danish Vikings, who occupied and controlled a large part of England after invading in 865, have left no clear genetic heritage. That suggests they didn’t settle in large numbers, Donnelly said.

The study also weighed in on the question of what happened after Anglo-Saxons migrated into Britain from Europe, which began in the fifth century. After they showed up, their language, cereal crops and pottery styles replaced those of the existing British population. The study argues that a substantial number of Anglo-Saxons showed up and intermingled with the locals, said study co-author Mark Robinson of Oxford.