The great outdoors may be one of the cheapest therapies for kids, a new study from Denmark shows. Kids who grow up surrounded by nature have up to 55% less risk of developing various mental disorders later in life, according to the paper from Aarhus University in Denmark, published in the Proceedings of the National Academy of Sciences in the United States of America.

The research used satellite data from 1985 to 2013 to map the proximity of green space to the childhood homes of 943,027 Danes, from birth to age 10, for whom they had longitudinal data on mental health outcomes, socioeconomic status, and place of residence. The study then compared access to green space to data on mental health outcomes for that population, and found that consistent access suggested a big difference when it came to the risk of developing one of 16 different mental disorders later in life.

“If you are surrounded by more green space consistently throughout childhood, you will have an even lower risk of having a psychiatric disorder,” said lead researcher Kristine Engemann, a postdoctoral fellow in the Department of Bioscience and the National Centre for Register-based Research at Aarhus University.

The mechanism through which kids’ mental health improves with access to green space is unclear. But we do know that being closer to nature has health benefits: It can encourage exercise and improve social cohesion. If you spend a lot of time in the park, you get to know your neighbors better and build a sense of investment in your community. Time outdoors is also associated with improved cognition. One study in Barcelona studied kids’ cognitive development over the course of a year in two different settings, while also controlling for socioeconomic status and family history. Children going to schools with more green space had higher cognitive development than those who had access to less green space. (In both of these studies, correlation is not causation; the researchers cannot show it was the green space that improved cognitive scores, only that those with access to more nature performed better cognitively.)

“Being in an urban environment is typically what we humans consider stressful,” said Engemann. Noise, air pollution, infections, and poor socio-economic conditions can increase the risk of developing a mental disorder. There’s also less space for kids to blow off steam.”For children, if you come back from school and you have a nice yard or you go to the park, that could help children restore their mental capacity faster,” she said.

The number of people living in cities is rising fast, with more than 50% of the world’s population now living in cities. While urban centers tend to provide better access to health and education resources, as well as jobs, there is evidence that people’s health takes a hit. The study cites studies showing that in some places, urban residents face an almost 50% higher risk of developing psychiatric disorders such as anxiety and mood disorders compared with their rural peers.

Engemann says that globally, there is a trend of “densification” in cities—constructing more buildings at the cost of making way for green space. “I think it’s important that we acknowledge the value that green spaces have, not because they are decorative or pretty but they can have real benefits to the people living in the city.” City planners, she said, should prioritize biophilic design, designing with an eye toward connecting humans and nature.

Green spaces, she said, are “potentially decreasing the risk of a lot of disorders, and can add up to a lot of potential benefits to a lot of people.”