Walk into any middle school classroom and it’s obvious that puberty hits some kids earlier than others. Some students daydream about kissing while others are still planning their latest LEGO creation. Now a new study suggests that the genes that drive puberty also influence some of the next stages of sexuality: age at first intercourse and—for women—age at first birth.

Of course, genes are not the only factor. Parenting, religion, social mores, peers and many other factors come into play. But researchers at the University of Cambridge estimate that genetics can explain about a quarter of the difference in the likelihood that an individual will have sex relatively early or wait to start. By comparison, about 80 percent of height is genetically determined and 30 to 50 percent of many common diseases are driven by genetics.

A person’s age at the onset of sexual behavior matters, because early sexuality and becoming a parent at a young age are linked to many measures of health and economic success. “If you look in [scientific] literature, relatively early ages at first sex and first birth have been associated with lower educational achievement, poorer physical health, poorer mental health—a complex web of negative stuff,” says John Perry, a geneticist at Cambridge who led the research, published Monday in Nature Genetics. Perry says he was particularly intrigued by the idea that something people think of as purely a matter of free choice would have a large contribution from genetics. (Scientific American is part of Springer Nature.)

Geneticist and pediatric endocrinologist Joel Hirschhorn at Boston Children’s Hospital, who was not involved in the study, says he also finds this result interesting and believable. But he thinks the team may have overstretched its data in making another conclusion: that the association they saw between genes involved in puberty and those involved in impulsivity and crankiness means these traits also play a causal role in the timing of sexual activities. The type of genomic analysis they used, called Mendelian randomization, can sometimes be difficult to interpret, according to Hirschhorn. “It might not be direct cause and effect,” he says, adding that more research will be needed to prove causality.

The research team relied on data from the UK Biobank, which has compiled genetic sequences. They also collected blood tests, questionnaires and other measures of health from 150,000 adults. The scientists ran a genome-wide association analysis on more than 125,000 participants who were of European ancestry and between ages 40 and 70. (Perry says that when the Biobank reaches its full complement of 500,000 participants, it will have enough data to include other racial and ethnic groups.)

The team found that 38 specific regions of the genome contributed to the age at which people first had sex. Those regions roughly fell into two groups, Perry says: genes that act on reproductive biological processes such as estrogen signaling and genes that appear to play a role in behavior and personality. One gene that the team associated with early sexual behavior, CADM2, influences risk-taking behavior, and another, MSRA, leads to irritability. “We weren’t expecting to find this sort of thing when we started out,” Perry says, but “if you’re thinking of risk-taking, if you’re thinking of irritability, you could see how that would have a downstream effect on your reproductive behavior and the choices you make.” He emphasizes that he is not saying that people’s genes make them have early sex but that genetic factors play a role in people’s actions around sexuality. “A lot of what we’re saying in the paper, I think any parent or any person would relate to,” he says. “If you’re maturing sexually ahead of your peers, you’re going to be spending more time chasing girls or boys than working, and your priorities change and your behaviors change.”

Psychologist Kathryn Paige Harden, who was not involved in the new research, says she liked the study because it corroborates her research on twins and also has the potential to change the public conversation about teenagers’ sexual activity.

Many people assume that it’s the early sexual activity itself that causes emotional trauma and leads to the bad outcomes that have been previously reported—including depression, delinquency and substance use problems—says Harden, an associate professor at The University of Texas at Austin. In Texas public schools are legally mandated to teach students that premarital sex causes “emotional trauma,” Harden notes. But she adds that the new study suggests genetics may underpin both early sexuality and emotional trauma, rather than early sexuality triggering the trauma.

Having the genetic tools provided by the study will help social scientists like herself deepen their own analyses, says Harden, who co-directs a research project with a sample of about 750 pairs of twins between eight and 18 years old. “Now I have a better control for being able to pull out what is the effect of environment or how does that genetic risk play out differently in different environments,” she says.