Heart disease is one of the most common chronic illnesses in the U.S., with over 600,000 Americans dying from the disease every year. Among depressed people, the risk of developing heart disease is even higher — they’re two to three times more likely to develop coronary heart disease than people who aren’t depressed, according to the National Heart, Lung, and Blood Institute.

As depressed patients may be more at risk of heart problems, consistent exercise could be the solution. A new study out of Emory University Hospital in Atlanta, Ga., published in the Journal of the American College of Cardiology, finds that regular exercise may reverse the negative cardiovascular effects of depression.

For the study, researchers analyzed 965 people who didn't have heart disease or a depression/mental health diagnosis. They asked them questions about their levels of depression and physical activity, then measured any early indicators of heart disease — such as artery stiffening and inflammation. These symptoms are typically associated with depression. The researchers found that people who were inactive were the most likely to experience early indicators of heart disease, while people who exercised regularly were way less likely to.

“Our findings highlight the link between worsening depression and cardiovascular risk and support routinely assessing depression in patients to determine heart disease risk,” said Dr. Arshed Quyyumi, an author of the study and co-director of the Emory Clinical Cardiovascular Research Institute in Atlanta, in the press release. “This research also demonstrates the positive effects of exercise for all patients, including those with depressive symptoms. There are many patients with heart disease who also experience depression — we need to study whether encouraging them to exercise will reduce their risk of adverse outcomes.”

According to Johns Hopkins Medicine Heart and Vascular Institute, depression may wreak havoc on the heart by lowering a person’s motivation to take better care of themselves, exercise, and eat well. Depressed people may avoid taking medications, overeat or not eat enough, and have a higher chance of turning to substance abuse or smoking to deal with psychological issues. The mental illness may also cause hormonal changes that trigger arrhythmias, or abnormalities in heart rhythm. In addition, depression has been linked to sticky platelets, which can contribute to the hardening of arteries and eventually heart attacks.

Unfortunately, it’s often hard to decipher which symptoms are caused by heart disease and which are caused by depression, as they’re all quite similar. Fatigue, an inability to sleep, and anxiety could be one or the other — or both. That’s why it’s important to approach heart disease with both a physical and a mental health viewpoint.

Past research has examined the link between exercise and depression, as well as exercise and heart disease, in the past. One study from 2014 found that adults who exercised regularly had a lower rate of depressive symptoms. Other studies have found that exercise can improve mood, anxiety problems, and overall quality of mental health.

However, while exercise may be generally beneficial for depressed people, it may not help those who are suffering from stress and anxiety. One 2015 study found that heart disease patients who were stressed actually didn’t benefit much from exe rcise, meaning that stress reduction should also be a major aspect of heart disease treatment. And exercise by itself may not be enough to lower heart disease risk — heart disease patients should avoid sitting too much throughout the day.

Source: Quyyumi A et al. Journal of the American College of Cardiology, 2016.