Why do some humans have lighter skin than others? Researchers have longed chalked up the difference to tens of thousands of years of evolution, with darker skin protecting those who live nearer to the equator from the sun’s intense radiation. But a new study of ancient DNA concludes that European skin color has continued to change over the past 5000 years, suggesting that additional factors, including diet and sexual attraction, may also be at play.

Our species, Homo sapiens, first arose in Africa about 200,000 years ago, and researchers assume that its first members were as dark-skinned as Africans are today, because dark skin is advantageous in Africa. Dark skin stems from higher levels of the pigment melanin, which blocks UV light and protects against its dangers, such as DNA damage—which can lead to skin cancer—and the breakdown of vitamin B. On the other hand, skin cells need exposure to a certain amount of UV light in order to produce vitamin D. These competing pressures mean that as early humans moved away from the equator, it makes sense that their skin lightened.

Recent research, however, has suggested that the picture is not so simple. For one thing, a number of genes control the synthesis of melanin (which itself comes in two different forms in humans), and each gene appears to have a different evolutionary history. Moreover, humans apparently did not begin to lighten up immediately after they migrated from Africa to Europe beginning about 40,000 years ago. In 2012, for example, a team led by Jorge Rocha, a geneticist at the University of Porto in Portugal, looked at variants of four pigmentation genes in modern Portuguese and African populations and calculated that at least three of them had only been strongly favored by evolution tens of thousands of years after humans left Africa. In January, another team, led by geneticist Carles Lalueza-Fox of the University of Barcelona in Spain, sequenced the genome of an 8000-year-old male hunter-gatherer skeleton from the site of La Braña-Arintero in Spain and found that he was dark rather than light-skinned—again suggesting that natural selection for light skin acted relatively late in prehistory.

To get a better idea of how European skin pigmentation has changed over time, a team led by Mark Thomas, an evolutionary geneticist at University College London, extracted DNA from 63 skeletons previously found at archaeological sites in modern-day Ukraine and surrounding areas. The researchers were able to sequence three pigmentation-related genes from 48 of the skeletons, dated between 6500 and 4000 years old: the gene TYR, which is involved in the synthesis of melanin; SLC45A2, which helps control the distribution of pigment-producing enzymes in skin cells; and HERC2, the primary gene that determines whether the iris of the eye is brown or blue. These three genes, like all pigmentation genes, come in numerous variants that lead to different shades of skin, hair, and eye color.

By comparing the variants of these genes in the ancient skeletons with those in 60 modern-day Ukrainians, as well as a larger sample of 246 modern genomes from the surrounding region, the team found that the frequency of variants related to lighter skin and hair, as well as blue eyes, increased significantly between the ancient and modern populations. For example, modern Ukrainians on average have more than eight times as many variants of TYR related to light skin, and four times as many variants related to blue eyes, as the ancient Ukrainians, the team reports online today in the Proceedings of the National Academy of Sciences. African populations, on the other hand, have none of these lighter variants.

Thus, while the prehistoric Ukrainians had apparently evolved relatively lighter skin and hair, and a higher frequency of blue eyes, in the time since their ancestors had left Africa, the data suggested that they were not done evolving. To further test this conclusion, the team performed computer simulations designed to distinguish between natural selection and “genetic drift,” a change in the frequency of genetic variants due just to chance. These tests—which take into account ancient population sizes and the rate at which genetic alterations occur, and can determine whether genetic drift alone can account for the speed of evolutionary changes—showed that the pigmentation genes were still undergoing strong natural selection after 5000 years ago; indeed, the selection pressure was as great as that for other genes known to be very strongly selected in humans, such as those involved in the ability to digest lactose and protection against malaria.

“The signs of selection are indeed persuasive,” Rocha says. By using ancient DNA, he says, the team was able to “provide direct evidence” that “strong positive selection was the likely driver” of the changes in pigmentation profiles.

But why was strong natural selection for lighter skin, hair, and eye color still going on thousands of years after humans left Africa and its brutal UV rays? In the case of skin color, the team speculates that these populations, which represented early farmers, had previously received a lot of vitamin D from their food, such as vitamin D-rich fish and animal livers, when they were hunter-gatherers. But after the advent of farming, when grains such as wheat and barley became a major part of their dinner plates, early Europeans needed to synthesize a larger amount of vitamin D in their skins. That’s when lightening up became very advantageous. The study “provides evidence that loss of regular dietary vitamin D as a result of the transition to a more strongly agricultural lifestyle may have triggered” the evolution of lighter skin, says Nina Jablonski, a leading skin color researcher at Pennsylvania State University, University Park.

As for the trend toward lighter colored hair and blue eyes, Thomas and his co-workers suggest that may be due to sexual attraction—what in evolutionary terms is called sexual selection. If so, then the originally rare males or females with light hair and blue eyes might have been attractive to the opposite sex and so had more offspring; this kind of sexual preference for individuals with unusual appearances has been confirmed in other animals, such as guppies.

Of course, in some of today’s cultures, a summer tan is also considered sexy, and here the study may provide some positive news: Modern variants of HERC2 can also make it easier to turn one’s skin golden brown in the sun.