The longitudinal study, published in The Lancet, tracked participants over five years across 12 countries.
Those who walked regularly reported 23% fewer symptoms of anxiety and 19% fewer symptoms of depression compared to sedentary groups.
Health officials are now considering whether walking programmes should be prescribed alongside traditional treatments.
The benefits were consistent across age groups, though older adults showed the most dramatic improvements in cognitive function.