People who are in the middle age of their lives are less likely to see the benefit of exercise in life if they are not getting enough sleep.
Scientists and researchers from the University College London (UCL) have found that those in their 50s and 60s who regularly exercised but slept less than six hours had a fast decline in certain skills, reports Wales Online.
These skills included things like memory loss and concentrating.
The team found that after 10 years, the participants' cognitive functions - like their learning, memory and attention skills - were the same as those who participated in less physical activity.
In the study, published in journal The Lancet Healthy Longevity, researchers highlighted the need for sleep in order to protect against cognitive decline as people age.
Lead author Dr Mikaela Bloomberg, of UCL Institute of Epidemiology & Health Care, said: "Our study suggests that getting sufficient sleep may be required for us to get the full cognitive benefits of physical activity.
"It shows how important it is to consider sleep and physical activity together when thinking about cognitive health.
"Previous studies examining how sleep and physical activity might combine to affect cognitive function have primarily been cross-sectional – only focusing on a snapshot in time – and we were surprised that regular physical activity may not always be sufficient to counter the long-term effects of lack of sleep on cognitive health."
During the research, the team looked at data from the from the English Longitudinal Study of Ageing (Elsa), that included almost 9,000 people aged 50 and older.
Their cognitive function was assessed over a period of 10 years with various memory and verbal fluency tests.
Questionnaires were also undertaken to assess how long each person slept, and if this was for more or less than six hours.
Participants were also quizzed on their levels of physical activity. At the start of the study, those who were more physically active also had better cognitive function regardless of how long they slept.
This began to change, however, over the decade-long period - as short sleepers who were more physically active experienced more rapid cognitive decline, according to research.
For those aged 70 and over, however, the benefits of exercise on cognitive function were maintained regardless of their sleep schedule.
Co-author Professor Andrew Steptoe, of UCL Institute of Epidemiology & Health Care, said: "It is important to identify the factors that can protect cognitive function in middle and later life as they can serve to prolong our cognitively healthy years and, for some people, delay a dementia diagnosis.
"The World Health Organisation already identifies physical activity as a way to maintain cognitive function, but interventions should also consider sleep habits to maximise long-term benefits for cognitive health."
Don't miss the latest news from around Scotland and beyond - sign up to our daily newsletter here.