Last updated: Jun 20, 2016

Being forgiving to yourself and others can protect against stress and the toll it takes on mental health, according to a new study in the Journal of Health Psychology.

Researchers looked at the effects of lifetime stress on a person’s mental health, and how more forgiving people fared compared to people who weren’t so forgiving. To do this, they asked 148 young adults to fill out questionnaires that assessed their levels of lifetime stress, their tendency to forgive and their mental and physical health.

No surprise, people with greater exposure to stress over their lifetimes had worse mental and physical health. But the researchers also discovered that if people were highly forgiving of both themselves and others, that characteristic alone virtually eliminated the connection between stress and mental illness.

“It’s almost entirely erased—it’s statistically zero,” says study author Loren Toussaint, an associate professor of psychology at Luther College in Iowa. “If you don’t have forgiving tendencies, you feel the raw effects of stress in an unmitigated way. You don’t have a buffer against that stress.”

How a forgiving personality protects a person from the ills of severe stress is hard to determine. The researchers speculate that people who are more forgiving may adopt better coping skills to deal with stress, or their reaction to major stressors may be dulled.

The sample of people in the study is small, and more research is needed to fully understand the benefits of being more forgiving. But Toussaint says he believes “100%” that forgiveness can be learned. Many therapists work to cultivate forgiveness in sessions, he says, and his own prior research has shown that saying a short prayer or a brief meditation on forgiveness can help people take the edge off.

“Forgiveness takes that bad connection between stress and mental illness and makes it zero,” he says. “I think most people want to feel good and it offers you the opportunity to do that.”

This article originally appeared on Time.com.