Scientists took DNA samples from Stone Age skeletons to learn more about how mating between different prehistoric human groups affected their DNA. Balázs G. Mende

Europe’s population changed dramatically during the Stone Age as foreign farmers moved in and had a lot of sex with the local hunter-gatherers.

New research shows there was more mating going on than scientists previously found evidence of — and European DNA these days is largely composed of genetic material from those immigrant farmers, but with small portions of the hunter-gatherer genes remaining.

According to a paper in the journal Nature, a team used DNA samples from that period, also known as the Neolithic Period and defined by its use of stone tools, to better understand how much interbreeding there was between the hunter-gatherer residents of Europe and the farmers from western Asia and northern Africa who migrated to the area. The dozens of samples came from Hungary, Germany and Spain and belonged to people who lived as early as 8,000 years ago and as recently as about 4,000 years ago.

The exact years of the Neolithic period can vary from place to place, as humans in some areas were quicker to adopt stone tools — and quicker to switch to bronze, which would propel them into the subsequent Bronze Age faster than their counterparts. But the Stone Age is often described as starting around 15,000 BCE in some places and possibly running to as late as about 2,000 BCE in certain areas. In addition to describing how advanced human technology was, the period also represented the beginning of proper human settlements.

As the paper notes, previous studies of ancient DNA have shown that Europeans had genes from both western Asian migrants and local hunter-gatherers. But it is not entirely clear how much of this genetic mixing occurred during the Stone Age and where it happened. Some experts suggest the migrants essentially took over Europe, edging out the hunter-gatherers to become the ancestors of modern Europeans.

But the real picture might be a middle ground. The scientists assert, based on their new analysis, that the process included frequent mating between the two groups.

“Admixture between groups with different ancestry profiles was pervasive and resulted in observable population transformation across almost all cultural transitions,” the authors wrote.

According to a report on the research, the team constructed a model of this mating and gene flow to observe how it may have happened. The results suggested that the sex started right after the migrants moved in and was common for hundreds of years afterward.

“We find that genetic diversity was shaped predominantly by local processes, with varied sources and proportions of hunter-gatherer ancestry among the three regions and through time,” according to the paper. “Our results shed new light on the ways in which gene flow reshaped European populations throughout the Neolithic period.”

And the report notes that the results make sense because “it would seem far more likely that contact between the two groups would result in interbreeding, rather than one group simply out-reproducing the other to the point that the original group simply disappeared.”

A grave from the early Stone Age in Hungary was one place scientists took DNA samples to learn more about the genetics of prehistoric Europe. Anett Osztás