It’s no surprise that upbeat, motivated people find it easier to get out and exercise. But exercise itself can actually improve mood and motivation as well, particularly for people with heart failure, a new study shows.

The finding is exciting not only because depression is very common and can be deeply debilitating among people with heart failure — up to 40% are clinically depressed and three-quarters score higher than average on tests of depressive symptoms, according to background information in the study — but it’s also consistent with previous research suggesting that exercise may be effective as a treatment for depression more widely.

“This study shows that exercise is associated not only with physical health benefits, but important mental health benefits as well,” lead study author James Blumenthal told reporters. The findings are published this week in the Journal of the American Medical Association (JAMA).

For the new study, more than 2,000 patients with heart failure across the U.S., Canada and France were tested for possible depression and then were randomly assigned to receive either usual care for their heart condition, or usual care plus a program of aerobic exercise — either riding a stationary bike or using a treadmill. After three months and again after 12 months, the study participants were followed up for depressive symptoms. The exercise group saw modest but statistically unambiguous reductions in depressive symptoms compared with the group that didn’t exercise.

After 30 months, when the study concluded, the exercise group was also found to have a very slightly lower risk of hospitalization and of death. This difference, although small, was also statistically unambiguous, in that there was a large enough number of people in the trial that it’s unlikely the finding was due to chance alone.

Blumenthal, a psychology professor at Duke University Medical Center, added that exercise has been shown to be safe for people with heart failure, and that exercise does not need to be strenuous or a huge time commitment for patients to see a difference.

“It doesn’t require intensive training for a marathon to derive benefits,” he said. “We’re talking about three, 30-minute sessions for an accumulated 90 minutes a week. And the results are significant improvements in mental health, reduced hospitalizations and fewer deaths.”

This latest experiment in JAMA is not the first to test the effects of exercise on depression, either. In 1999, in fact, Blumenthal and other colleagues published results from a trial of people who suffered from major depressive disorder, without heart failure. There too, the researchers found that aerobic exercise helped to alleviate depressive symptoms somewhat — working just as well as front-line antidepressant drugs.

With the new findings among heart-failure patients, the clinical investigators write that they can “confirm and extend previous research,” by showing the benefits of exercise in a vulnerable population, where the burden of depression is very large.

In their JAMA article, the study authors warn that the difference between patients assigned to exercise and those assigned to usual care was still “modest” and that “the clinical significance of this small improvement is not known.” However, they add, because the effects did seem to persist over a full year of follow-up, there’s cause for optimism. This difference, they write, “is likely to be associated with better social functioning and higher quality of life.”