A "sleep diet" may be the best way to slim for someone with an inherited tendency to put on weight, research suggests.
Sleeping more than nine hours a night appears to suppress genetic factors that lead to weight gain, a study has found.
In contrast, getting too little sleep seems to have the opposite effect.
Previous research has shown an association between poor sleep and obesity, but the new findings reveal a complex interaction between sleep and genetic factors linked to body weight.
Scientists made the discovery after studying 1,088 pairs of identical and non-identical twins.
Twin studies help researchers to unravel genetic and environmental influences. Only identical twins share exactly the same genes, and are therefore subject to the same genetic effects, so differences between them are likely to be due to environmental factors.
Non-identical twins do not share the same genes, and may exhibit genetic differences.
The new study found that heritability of body mass index (BMI) - a measurement relating weight and height - was twice as high for short than for long sleepers.
For twins sleeping less than seven hours a night, genetic factors accounted for 70% of differences in BMI.
In the case of twins averaging more than nine hours of sleep, only 32% of weight variations could be attributed to genes.
Dr Nathaniel Watson, from the University of Washington, who led the US study, said: "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."
The findings were published today in the journal Sleep.
Participants in the study slept for 7.2 hours a night on average. They were mostly young, with an average age of 36.6, well educated, Caucasian and female.
Their average BMI was 25.3, which falls just inside the "overweight" category. Clinical obesity is defined by a BMI of 30 or above.
A total of 38% were female-female identical twins, which made up the most common pairing.
In their paper, the scientists suggest that hectic modern western lifestyles may contribute to obesity.
"Modern society with its ubiquitous technology often can cause misalignment between sleep need and sleep actualisation," they wrote. "This frequently has adverse consequences for cognitive (mental) function and metabolic, cardiovascular, and immunologic health.
"Indeed, over the past century habitual sleep duration has dropped 1.5 hours per night and since 2001 the percentage of US adults getting at least eight hours of sleep per night on weeknights has fallen from 38% to 27%."
They added: "Evidence is mounting that chronically reduced sleep times are associated with obesity."
Sleep may influence weight by affecting hormones, glucose metabolism and inflammation, said the scientists.
Some studies have associated long sleep duration with heart disease, insulin resistence (a precursor to diabetes) and early death.
"We did not observe this in our sample, but our sample is much younger than those used in studies that established these adverse associations," the researchers wrote.
They said it was likely an individual benefited from more sleep "until sleep need and sleep actualisation are balanced".