Getting some extra z’s each night could dampen the effect of genes that predispose you to weight gain, a recent study from University of Washington in Seattle finds.

The research team, led by neurologist Nathaniel Watson, looked at the weight and sleeping habits of 1,088 pairs of twins in the University of Washington Twin Registry and found that those who got less sleep — less than 7 hours a night — were not only heavier, but also had less control over their weight than those who got more than 9 hours of shuteye.

Watson’s team found that among twins sleeping less than 7 hours, genes accounted for 70% of the difference in body mass index (BMI), while environment accounted for only 4% of the difference. Conversely, among twins getting more than 9 hours of sleep, genetic influences accounted for 32% of the BMI difference — or less than half the effect found in the short-sleeping twins — while environmental factors like diet and exercise accounted for 51% of the differences in weight.

“The less sleep you get, the more your genes contribute to how much you weigh. The more sleep you get, the less your genes determine how much you weigh,” Watson, co-director of the University of Washington Medicine Sleep Center, in Seattle, toldUSA Today.

The study was based on self-reported data on height, weight and sleep from 604 pairs of identical twins and 484 sets of fraternal twins. Participants fell into the category of short-sleepers if they slept less than 7 hours a night. Normal sleep was 7 to 8.9 hours a night, and long sleep was anything over 9 hours.

“The results suggest that shorter sleep provides a more permissive environment for the expression of obesity related genes. Or it may be that extended sleep is protective by suppressing expression of obesity genes,” said Watson in a statement.

Previous studies have shown that not getting adequate slumber is also linked with weight gain, but those studies, which have largely involved non-twin participants, haven’t been able to tease out the effect of weight-gaining genes.

While the current study didn’t pinpoint exactly which genes were at play, researchers know that many human genes affect obesity risk by influencing mechanisms like glucose metabolism, energy use, fat storage and appetite.

In the past, researchers also thought that getting too much sleep could lead to overweight, but this study shows that may not be the case. “The paper is supporting the long-time belief that there is an association between body mass index and duration of sleep, but the effect of more sleep may not be as powerful as we believed,” Dr. David Schulman, a medical director of the Emory Sleep Disorders Laboratory, told ABC News.

More research is needed to determine which biological mechanisms are at work and exactly how much sleep is enough to override the influence of obesity genes, but the results add to the evidence that adequate sleep is crucial to maintaining a healthy weight.

“Does this mean you can sleep yourself thin? Probably not. But you can sleep yourself to a point where environmental factors, like diet and activity, are more important in determining your body weight than genetics,” Watson told the Huffington Post.