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".
"Those who curl up in the foetus position are described as tough on the outside but sensitive at heart. They may be shy when they first meet somebody, but soon relax. The foetus is the most common sleeping position, with women more likely to adopt this position than men."
"Lying on your back with both arms up around the pillow. These sleepers make good friends because they are always ready to listen to others, and offer help when needed. They generally don't like to be the centre of attention."
"Lying on your front with your hands around the pillow, and your head turned to one side. Often gregarious and brash people, but can be nervy and thin-skinned underneath, and don't like criticism, or extreme situations."
"Lying on your back with both arms pinned to your sides. People who sleep in this position are generally quiet and reserved. They don't like a fuss, but set themselves and others high standards."
"People who sleep on their side with both arms out in front are said to have an open nature, but can be suspicious, cynical. They are slow to make up their minds, but once they have taken a decision, they are unlikely ever to change it."
"Lying on your side with both arms down by your side. These sleepers are easy going, social people who like being part of the in-crowd, and who are trusting of strangers. However, they may be gullible."