Eight hours is no longer the ideal duration of sleep each night in middle age, according to science.
The downgrade comes after studying the sleep pattern of half a million Britons aged 38 to 73.
People who got more or less than seven hours per night scored worse in tests for thinking speed, attention span, memory and problem-solving.
Until now, getting eight hours of undisrupted sleep was thought to be the Goldilocks zone for sleep, providing the best overall health benefits.
But disruption to sleep — which happens to both those who sleep too little and for too long — is associated with a buildup of plaque in the brain — a tell-tale sign of dementia.
The Cambridge University study shows the link between hours of sleep per night and different measures of brain function (blue lines), including memory and reaction time, as well as mental health, including depression and anxiety. The findings suggest those who get seven hours of sleep are at the best cognitive performance and mental health, with more or less sleep resulting in poorer performance (shown in U-shaped curve)
Sleep is essential for brain plasticity — its ability to process information and remember things — as well as removing waste products from brain cells, regulating metabolism and maintaining the immune system.
The NHS recommends six to nine hours of sleep every night for adults, whereas the developing brains of children need up to 12 hours per night.
But middle-age and older adults often find it more difficult to fall asleep and stay asleep. Experts believe this speeds up cognitive decline and can spur on psychiatric problems in our senior years.
HOW MUCH SLEEP SHOULD I GET?
Most adults need between six and nine hours of sleep every night.
Going to bed and getting up at a similar time each night programmes the brain and internal body clock to get used to a set routine.
But few people manage to stick to strict bedtime patterns.
To get to sleep easier, the NHS advises winding down, such as by taking a bath, reading and avoiding electronic devices.
The health service also recommends keeping the bedroom sleep-friendly by removing TVs and gadgets from the room and keeping it dark and tidy.
For people who struggle to sleep, the NHS says keeping a sleep diary can uncover lifestyle habits or activities that contribute to sleepiness.
The researchers examined data from 498,277 adults aged 38 to 73, gathered from the UK Biobank — a database of patients monitored for 10 years.
Participants were quizzed about their sleeping patterns, mental health and wellbeing and took part in a series of cognitive brain tests — completed on a touchscreen tablet — including assessments of their reaction time and memory.
The results, published in the journal Nature Aging, shows both insufficient and excessive sleep duration is linked with impaired cognitive performance, such as processing speed, visual attention, memory and problem-solving skills.
Those who got seven hours of sleep per night had the healthiest brains.
They had the best cognitive performance and mental health — with lower levels of anxiety and depression and better wellbeing — compared to those getting more or less than seven hours sleep.
The researchers said one reason for their finding could be that those getting fewer than seven hours were suffering disruption to their slow-wave deep sleep.
Those getting too much sleep could also be affected, because extended shut-eye can cause poor-quality and fragmented deep sleep.
Interruptions to this type of sleep have been linked with a build-up in the brain of a protein called amyloid, which is one of the leading theories about how dementia develops.
Amyloid occurs naturally but high levels of it causes the protein to clump together and form plaques that cause ‘tangles’ in the brain and disrupt cell function.
The researchers noted that a lack of sleep may also make it harder for the brain to rid itself of toxins.
And brain imaging data from around 40,000 of the participants showed a link between sleep duration and the structure of brain regions involved in cognitive processing and memory.
Those who had more or less than seven hours had bigger changes in these areas — including the precentral cortex, lateral orbitofrontal cortex and the hippocampus — the team found.
The researchers also noted that consistently getting seven hours of sleep each night ‘without too much fluctuation in duration’ was important for brain function and mental health.
Professor Barbara Sahakian, a neuroscientist at the university and study co-author, said: ‘Getting a good night’s sleep is important at all stages of life, but particularly as we age.
‘Finding ways to improve sleep for older people could be crucial to helping them maintain good mental health and wellbeing and avoiding cognitive decline, particularly for patients with psychiatric disorders and dementias.’
Professor Jianfeng Feng, a brain expert at Fudan University in China and study co-author, said: ‘While we can’t say conclusively that too little or too much sleep causes cognitive problems, our analysis looking at individuals over a longer period of time appears to support this idea.
‘But the reasons why older people have poorer sleep appear to be complex, influenced by a combination of our genetic makeup and the structure of our brains.’