Nature really can be healing. A new study shows that removing trash and adding trees to empty lots helped people feel happier and reduced symptoms of depression.

In what is perhaps the first scientific study of the effects of public spaces on mental health, a non-profit group in Philadelphia cleaned up trash-filled vacant lots and "greened up" others, primarily in low-income areas, and found that residents reported feeling happier.

“Doctors can treat depression, drugs and wounds, but we need to look at what brings the patients in in the first place.”

The study, published Friday in the new open-access Journal of the American Medical Association Network Open, looked at 541 vacant lots around Philadelphia. In a third, trees and grass were planted, and trash was removed from another third — but the remainder weren’t touched at all.

Researchers from the University of Pennsylvania spoke to 342 local residents several times to track their emotional state over the three-year period of the cleanup study, from 2011 to 2014.

They found that residents of areas that had either the greening or trash removal projects reported a decrease in feelings of depression by about 40 percent. In neighborhoods below the poverty line, the drop was 70 percent. Researchers also found reductions in feelings of worthlessness, hopelessness and overall poor mental health.

Dr. Eugenia South, an emergency room doctor at University of Pennsylvania Hospital and a corresponding author of the study, said she was not surprised by the results.

“This is further evidence that where people live has an impact on their health,” she told NBC News.

The Philadelphia Horticultural Society cleaned up and planted trees in several vacant lots in a study of how public spaces affect mental health. JAMA Network Open

For residents near lots that were not cleaned up, the levels of depression stayed the same or changed only slightly.

Renee Holly, 54, is a lifelong resident of North Philadelphia. She said she loves the grass and trees that have replaced the trash in the vacant lot on her block.

“It’s a beautiful thing to have a clean lot, it makes me happy,” she said. “Now, our neighborhood kids don’t have to play in a lot with glass and trash.”

Holly, who works as a custodian, is a block captain in her neighborhood, charged with keeping it in good condition. She said community residents take responsibility with help from the Pennsylvania Horticultural Society, which conducted the cleanups.

"They helped us take it to better place, and I'm so thankful," she said.

The positive individual mental health effects the study found can also change behavior, and affect the community at large, South said.

As an emergency room doctor, South regularly sees victims of gun violence and drug overdoses. “I have an overdose probably every shift I work,” she said.

South wanted to research the root causes that bring so many people into the emergency room with gun wounds and overdoses, and find ways to address them.

"This study shows there are simple things we can do to move the needle on that,” she said.

She referred to a separate study, published in February, that analyzed crime data in the same areas that received cleanup. It found reductions in gun violence, overall crime and fear of crime.

“When the lots were cleaned up, needles and condoms were found,” she said. “The abandoned, cluttered spaces encouraged crime.”

Spaces that were already cleaned up will keep being cared for. The Pennsylvania Horticultural Society returns every two weeks, except during the dead of winter, for maintenance, South said.

But South hopes that the results of the study will resonate with physicians and city officials working in urban planning and public health, and inspire more projects to clean up public spaces.

“Doctors can treat depression, drugs and wounds,” she said. “But we need to look at what brings the patients in in the first place.”

CORRECTION (July 20, 2018, 8:11 p.m. ET): An earlier version of this article misstated the name of the organization that conducted the cleanups. It is the Pennsylvania Horticultural Society, not the Philadelphia Horticultural Society.