Aerobic exercise such as running, swimming or dancing can be considered a frontline treatment for mild depression and anxiety, according to research that suggests working out with others brings the most benefits.

Scientists analysed published reviews on exercise and mental health and found that some of the greatest improvements were observed in young adults and new mothers – groups that are considered particularly vulnerable to mental health problems.

While aerobic group exercise emerged as the most effective physical activity for reducing depression and anxiety, low-intensity programmes that lasted only a couple of months may be best for anxiety, the researchers said.

“Exercise can have a similar effect, and sometimes a stronger impact, than traditional treatments,” said Neil Munro, a psychologist at James Cook University in Queensland, Australia. “Getting moving, in whatever shape or form works best for each person, can help mitigate depression and anxiety symptoms.”

The researchers analysed data from 63 published reviews that looked at the impact of exercise on depression or anxiety in nearly 80,000 volunteers. The study aimed to identify the effect of exercise across all ages, and in pregnant women and new mothers. The exercises ranged from resistance training and aerobic workouts to mind-body activities such as yoga and tai chi.

Forms of aerobic exercise that boosted the heart rate had the biggest impact on depression, with resistance training and yoga having a lesser effect. A similar trend was seen for anxiety but the impact was smaller, the study found.

Further benefits were seen in people who took part in group exercise or supervised activities, the researchers write in the British Journal of Sports Medicine. This suggests socialising plays “a crucial role in the antidepressant effects of exercise”, Munro said.

According to the World Health Organization, more than 280 million people worldwide have depression and 301 million have anxiety disorders. In the UK and elsewhere, cases have risen sharply among 16- to 24-year-olds in the past decade. About 15 to 20% of new mothers experience depression and anxiety in the first year after giving birth.

Dr Brendon Stubbs, who studies exercise and mental health at King’s College London, urged caution over the findings because they relied heavily on mild cases.

“For people with mild or subclinical symptoms, exercise can reasonably be considered a frontline treatment option,” he said. “However, there is no evidence from this study, or from the wider literature, to suggest that people should change or discontinue established treatments such as psychotherapy or medication.”

For many people with severe depression, even basic daily activities could be extremely challenging, he added, and their symptoms often needed to improve before they could attempt exercise.

Prof Michael Bloomfield, a psychiatrist at UCL, said: “It’s good news that group exercise such as Zumba can reduce symptoms of anxiety and depression for some people, likely through a mix of physical activity, social connection, fun, dance and routine, and the evidence supports it as a potential useful adjunct to care.”

But he said for many people with more severe depression, taking part in energetic group activities was unrealistic. “For that reason, exercise should be seen as a complement to, not a replacement for, evidence-based treatments such as psychological therapies and medication where these are clinically indicated,” Bloomfield said.