Religion has long been linked to improved mental health, but a new study finds that it might be even more beneficial than volunteering or engaging in sports. The study, which was completed at the London School of Economics (LSE), examined older Europeans and found that those who joined a religious group experienced more mental health benefits than those who were involved in charity work, sports, or education.

“The church appears to play a very important social role in keeping depressing at bay and also as a coping mechanism during periods of illness in later life,” Dr. Mauricio Avendano, an epidemiologist at LSE and an author of the study, said in the press release. “It is not clear to us how much this is about religion per se, or whether it may be about the sense of belonging and not being socially isolated.”

The study also found that, interestingly, sometimes joining political or community organizations lost its benefits over time. The short-term benefits from social connection often evolved into depressive symptoms later on, the researchers noted.

Plenty of research has tried to examine the impact of religion on mental health, and even the body. In one study, researchers analyzed Buddhists, Catholics, Jews, Protestants, and Muslims, and attempted to pinpoint how spirituality influenced their well-being. They found that religion and spirituality was linked to a stronger connection to the rest of humanity and the universe, ultimately helping people be less stressed and self-centered.

However, there have been negative mental health outcomes linked to religion as well. In a 2013 study, researchers found that people who believed in a punitive God were more likely to have emotional problems like social anxiety, paranoia, obsessions, and compulsions. And another recent study found that while praying is often associated with mindfulness and meditation, it might sometimes exacerbate anxiety disorders.

There are still plenty of questions surrounding the LSE study — such as whether the people who took part in social activities and religious groups did so to battle their depression, or if they were happier to begin with.

“Our findings suggest that different types of social activities have an impact on mental health among older people, but the strength and direction of this effect varies according to the activity,” Avendano said in the press release. “One of the most puzzling findings is that although healthier people are more likely to volunteer, we found no evidence that volunteering actually leads to better mental health. It may be that any benefits are outweighed by other negative impacts of volunteering, such as stress.”