Physical exercise can reduce the force of both burnout—mental, physical or emotional exhaustion—and depression, according to a study published in the Journal of Applied Psychology and reported by American Friends of Tel Aviv University.

For the study, researchers followed 1,632 Israelis who had come to medical clinics for routine checkups. Participants filled out questionnaires to assess their mental and emotional states. They followed that with three clinic visits during a nine-year period.

To evaluate survey results, researchers divided participants into categories based on how much physical activity they engaged in each week: none, 75 to 150 minutes, 150 to 240 minutes, or over 240 minutes. For the study, physical activity was defined as anything that got participants’ heart pumping and made them break a sweat.

Researchers found that while depression increased the risk of job-related burnout and vice versa, increased physical activity reduced the risk of both over the next three years. What’s more, scientists noted participants began experiencing exercise benefits at 150 minutes per week. In addition, those who exercised more than 240 minutes per week were less than half as likely to suffer from burnout or depression as those who didn’t exercise, and among those who did suffer burnout or depression, the effects were relatively mild.

What does this mean for you? Well, exercise—especially if it’s for at least two and a half hours a week—is good for your mind as well as your body.

But keep this in mind: Exercise won’t necessarily replace therapy and/or medication for those suffering from serious depression. This means be sure to consult your doctor instead of your personal trainer about a case of the blues.

Click here to read about other alternative treatments for depression and anxiety.