Generally, friends are good for you. Decades of research link loneliness not just to depression, but to physical health problems as well. A seminal 1979 study reported that risk of death over nine years was more than doubled for adults with the fewest social ties, compared to those with the most. Since then, scientists have continued to connect social isolation with mortality, as well as specific conditions like cancer. And a recent study published in Annals of Behavioral Medicine underscores one thing in particular: how relationships help protect the heart. Physically. But I suppose if you want, you can see it as a metaphor, too.

Researchers at Concordia University in Montreal, and Rush University Medical Center in Chicago recruited 60 international students at Concordia shortly after they arrived in Canada, making sure they’d be equally lonely to start out with—none of them had friends or family in the area, nor were they in romantic relationships. Participants had their heart rates measured on the first visit to the lab, and then at follow-up appointments two and five months afterward. They also answered questionnaires about their social lives during these visits, reporting how many people they saw and talked to at least once a week.

The study found that how well students integrated socially in their new environment was associated with changes in their heart-rate variability (differences in the length of time between heartbeats).

“Other research has shown that individuals with a lower heart-rate variability are at increased risk for the development of poor health, including greater risk for cardiac diseases,” lead study author Jean-Philippe Gouin said in a press release. “Therefore, decreases in heart-rate variability are bad for you.”

The students with less social integration had lower heart-rate variability, while those who made more friends over the five months saw their heart rate variability increase, even after controlling for individual differences in extraversion. This was a relatively short time period, of course, but low heart rate variability over years could put lonely people’s hearts at risk.

Plenty of other studies have linked a lack of social interaction to heart problems. The Swedish Survey of Living Conditions, which surveyed more than 17,000 people, found that those with the fewest social contacts were at a 50 percent higher risk for dying of cardiovascular disease. And once someone has a heart problem, friends improve her chances of survival. In one study, women with suspected coronary artery disease were more than twice as likely to be alive after two years if they had a wider social circle, and also had lower rates of hypertension and diabetes. And in an American Heart Association study, after a heart attack, patients with low social support were more likely to have depressive symptoms and report low quality of life.

As Gouin’s study suggests, lower heart-rate variability could be one thing that accounts for the connection between social isolation and poor heart health. Another possibility is stress—stress is linked to heart disease, as well as many other conditions. Social support might help mitigate stress, and protect the body somewhat from its negative effects. In one small study, when children hung out with their best friends during a stressful situation, they had lower levels of the stress hormone cortisol (which, in high levels over time, increases the risk for heart disease). The participants in Gouin’s study didn’t have their best friends in their city, but they still saw results with the presumably more casual connections they were able to make in five months.

The factors that go into heart-disease risk create a tangled web, but life’s web is tangled too. The health of the heart is inextricable from the health of the rest of the body, and a person is inextricable from his environment. And for your heart, it seems, it’s better to have people in that environment than not to.