When agriculture arrived in Europe some 8,500 years ago, humans didn’t simply adapt their lifestyles and eating habits, but also their genes.

Researchers, led by geneticist David Reich at Harvard Medical School, analyzed the DNA of 230 ancient humans who lived between 3,000 and 8,500 years ago and found 12 positions on the human genome where natural selection seems to have occurred with the advent of farming. The scientists were also able to trace which genes were passed down from various prehistoric ancestors.

Harvard Medical School European ancestors include hunter gatherers (circled in green), Eurasian steppe populations (circled in red), and early European farmers (circled in blue).

In a paper published in Nature, the researchers show that northern Europeans seem to have a stronger genetic link to a particularly tall nomadic population from the Eurasian steppe who came to Europe around 4,500 years ago. Because of these genes, northern Europeans are still tall compared to others on the continent.

Southern Europeans became shorter as they turned to farming, as genes connected to reduced height were passed down through the generations. These shorter genes were inherited from Neolithic and Chalcolithic populations on from the Iberian peninsula, though it’s not clear why this happened in the south but not the north.

After they began farming, ancient Europeans also evolved to have lighter skin pigmentation, which is better able to capture vitamin D from the sun. Reich hypothesizes that earlier prehistoric hunter-gatherers didn’t need lighter skin, as the meat they caught provided enough Vitamin D, according to the New York Times (paywall).

The researchers also found genetic variants that allowed humans to digest lactose as adults, as well as genes for metabolizing fats and circulating vitamin D.

The analysis of ancient DNA, from humans who once lived across what is now Europe, Siberia and Turkey, includes studies of 83 samples that had not been examined before. The researchers were also able to look at 26 DNA samples from the Mediterranean, where the warmer climate means DNA is more likely to break down.

The team was able to gather such a data set thanks to recent extraction techniques that allowed them to analyze DNA from the petrous bone.

Co-senior author Ron Pinhasi, associate professor of archaeology at University College Dublin, said in a statement that the findings are “quite amazing.” As well as evidence of genetic solution, the DNA analysis shows how farming travelled to Europe. He added: