Getting too little sleep for several nights in a row disrupts hundreds of genes that are essential for good health, including those linked to stress and fighting disease.

Tests on people who slept less than six hours a night for a week revealed substantial changes in the activity of genes that govern the immune system, metabolism, sleep and wake cycles, and the body's response to stress, suggesting that poor sleep could have a broad impact on long-term wellbeing.

The changes, which affected more than 700 genes, may shed light on the biological mechanisms that raise the risk of a host of ailments, including heart disease, diabetes, obesity, stress and depression, in people who get too little sleep.

"The surprise for us was that a relatively modest difference in sleep duration leads to these kinds of changes," said Professor Derk-Jan Dijk, director of the Surrey Sleep Research Centre at Surrey University, who led the study. "It's an indication that sleep disruption or sleep restriction is doing more than just making you tired."

Previous studies have suggested that people who sleep less than five hours a night have a 15% greater risk of death from all causes than people of the same age who get a good night's sleep. In one survey of workers in Britain more than 5% claimed to sleep no more than five hours a night. Another survey published in the US in 2010 found that nearly 30% of people claimed to sleep no more than six hours a night.

Professor Dijk's team asked 14 men and 12 women, all healthy and aged between 23 and 31 years, to live under laboratory conditions at the sleep centre for 12 days. Each volunteer visited the centre on two separate occasions. During one visit, they spent 10 hours a night in bed for a week. In the other, they were allowed only six hours in bed a night. At the end of each week, they were kept awake for a day and night, or around 39 to 41 hours.

Using EEG (electroencephalography) sensors, the scientists found that those on the 10 hours-per-night week slept around 8.5 hours a night, while those limited to six hours in bed each night got on average 5 hours and 42 minutes of sleep.

The time spent asleep had a huge effect on the activity of genes, picked up from blood tests on the volunteers, according to a report in the US journal Proceedings of the National Academy of Sciences. Among the sleep-deprived, the activity of 444 genes was suppressed, while 267 genes were more active than in those who slept for longer.

Changes to genes that control metabolism might trigger or exacerbate conditions such as diabetes or obesity, while disruption to other genes, such as those that govern the body's inflammatory response, might have an impact on heart disease. Further genes that were affected have been linked to stress and ageing.

Sleep loss also had a dramatic effect on genes that govern the body's biological clock, suggesting that poor sleep might trigger a vicious cycle of worsening sleep disruption. The tests showed that people who slept for 8.5 hours a night had around 1,855 genes whose activity rose and fell over a 24-hour cycle. But in the sleep deprived, nearly 400 of these stopped cycling completely. The remainder rose and fell in keeping with the biological clock, but over a much smaller range.

"There is a feedback between what you do to your sleep and how that affects your circadian clock, and that is going to be very important in future investigations," said Dijk.

The researchers did not check how long it took for genes to return to their normal levels of activity in the sleep-deprived volunteers, but they hope to in further studies. Though scores of genes were disrupted in the sleep-deprived, the scientists cannot say whether those changes are a harmless short-term response to poor sleep, a sign of the body adapting to sleep-deprivation, or are potentially harmful to health.

Jim Horne, professor of psychophysiology at Loughborough University's Sleep Research Centre, said: "The potential perils of 'sleep debt' in today's society and the need for 'eight hours of sleep a night' are often overplayed and can cause undue worry. Although this important study seems to support this concern, the participants had their sleep suddenly restricted to an unusually low level, which must have been somewhat stressful.

"We must be careful not to generalise such findings to, say, habitual six-hour sleepers who are happy with their sleep. Besides, sleep can adapt to some change, and should also be judged on its quality, not simply on its total amount."