Parks, gardens and green space in urban areas can improve the wellbeing and quality of life of people living there, says a University of Exeter study.
Using data from 5,000 UK households over 17 years, researchers found that living in a greener area had a significant positive effect.
The findings could help to inform urban planners and have an impact on society at large, they said.
The study is published in the journal Psychological Science.
The research team examined data from a national survey that followed more than 5,000 UK households and 10,000 adults between 1991 and 2008 as they moved house around the country.
They asked participants to report on their own psychological health during that time to estimate the "green space effect".
Dr Mathew White and colleagues at the European Centre for the Environment and Human Health found that individuals reported less mental distress and higher life satisfaction when they were living in greener areas.
This was true even after the researchers accounted for changes over time in participants' income, employment, marital status, physical health and housing type.
Benefits for society
Dr White compared the scale of the effects of living in a greener area to "big-hitting" life events such as marriage.
"We've found that living in an urban area with relatively high levels of green space can have a significantly positive impact on wellbeing, roughly equal to a third of the impact of being married."
The effect was also found to be equivalent to a tenth of the impact of being employed, as opposed to unemployed.
Even when stacked up against other factors that contribute to life satisfaction, living in a greener area had a significant effect, the study said.
"These kinds of comparisons are important for policymakers when trying to decide how to invest scarce public resources, such as for park development or upkeep, and figuring out what bang they'll get for their buck," said Dr White.
While the effect for an individual might be small, he pointed out that the potential positive effects of green space for society at large might be substantial.
"This research could be important for psychologists, public health officials and urban planners who are interested in learning about the effects that urbanisation and city planning can have on population health and wellbeing."
Beth Murphy, information manager at the mental health charity Mind, said: "For people living busy lifestyles in densely populated areas, being able to get outdoors and access green space is a great way to escape the stresses of day-to-day life.
"Our research has shown that 94% of people who took part in outdoors 'green exercise' said it benefited their mental health and can have huge impacts on physical health.
"We believe this is food for thought for any policymaker involved in urban planning, or local authority developing its public health strategy."