Researchers found that people in their twenties, thirties and forties who were not active and then took up some form of exercise saw their risk of depression reduced by about 16 per cent.
The large-scale and long-term study has established a two-way relationship between depression and physical activity.
It found that people who increased their weekly activity reported fewer depressive symptoms. However, it also showed those with more depressive symptoms were less active, particularly at younger ages.
The study, carried out by researchers at University College London (UCL) and published in the journal JAMA Psychiatry, followed 11,135 people born in 1958 up until the age of 50, recording depressive symptoms and levels of physical activity at regular intervals in adulthood.
They found that each additional activity session per week reduced the odds of developing depression by 6 per cent.
Recent Scottish Government statistics show 19 per cent of men and 23 per cent of women had very low activity levels in Scotland. Also, one in four people in the country can expect to suffer at least one mental health illness, such as depression, at least once in their lifetime.
The study suggests that activity could significantly improve people’s mental as well as physical health.
Study lead author Dr Snehal Pinto Pereira said: “Assuming the association is causal, leisure time physical activity has a protective effect against depression. Importantly, this effect was seen across the whole population and not just in those at high risk of clinical depression.
“The more physically active people were, the fewer depressive symptoms they reported.
“Just as someone might be a little overweight but not clinically overweight or obese, many people who are not clinically depressed could still experience some depressive symptoms.”
Among those questioned, people who reported more depressive symptoms at age 23 tended to be less physically active, but this effect lessened as they grew older.
Dr Pinto Pereira said this was an important finding in relation to government policies designed to get people more active, as it showed depression was a barrier to activity itself among young adults.
The study is significant as previous ones focusing on the same area have produced mixed results.
But the size and long-term nature of the current one suggests that exercise has an important role to play in mental health in the general population.
Study senior author Doctor Chris Power said: “If everyone was physically active at least three times a week, we would expect to see a drop in depression risk, not to mention the benefits for physical health, as pointed out by other research, including reduced obesity, heart disease and diabetes.”
Professor Mark Petticrew, of the London School of Hygiene and Tropical Medicine, added: “Many people are already aware of the benefits of physical activity on their general health, but we are now seeing a growing body of evidence that suggests it also has a positive effect on a person’s mental wellbeing.
“This latest research highlights just how important it is to ensure that people are working and living in environments that allow them to be both physically active and mentally healthy.”