During my final semester of undergrad, I made two signs that read, “Feeling stressed about exams? Have a free hug!” Then I recruited a friend and we stood in the entrance of the campus library, held up the signs, and waited. Passerbys had one of two reactions: Either they quickly looked down at their phones and awkwardly shuffled by, or their faces lit up as they embraced us. Most people were enthusiastic. Some exclaimed, “You made my day!” or “Thank you. I needed this.” One leapt into my arms, nearly toppling me over. After two hours of warm interactions, my friend and I couldn’t believe how energized and happy we felt.

A study published earlier this month suggests that, in addition to making us feel connected with others, all those hugs may have prevented us from getting sick. At first, this finding probably seems counterintuitive (not to mention bizarre). You might think, like I did, that hugging hundreds of strangers would increase your exposure to germs and therefore the likelihood of falling ill. But the new research out of Carnegie Mellon indicates that feeling connected to others, especially through physical touch, protects us from stress-induced sickness. This research adds to a large amount of evidence for the positive influence of social support on health.

Social support can broadly be defined as the perception of meaningful relationships that serve as a psychological resource during tough times. More specifically, this means emotional support, such as expressions of compassion, and may include access to information or other assistance. The researchers measured social support by giving out a questionnaire in which participants rated different statements (e.g. “I feel that there is no one I can share my most private worries and fears with.”). Then, they conducted interviews every night for two weeks to find out how often participants experienced conflict with others and how often they received hugs. Finally, the researchers infected participants with a common cold virus and observed what happened.

Several interesting results emerged. Encouragingly, people overall had a strong sense of social support, as shown by a high median score on the questionnaire. Similarly, they were more likely to be hugged (which happened on an average of 68% of days during the two-week interview period) than to experience conflict (7% of days).

The most important results, however, were what the researchers deemed a “stress-buffering effect.” Keep in mind that interpersonal conflict can cause people a lot of stress and thereby weaken their immune systems. Yet regardless of how much conflict they endured, participants with a strong sense of social support developed less severe cold symptoms than those who felt socially deprived. Likewise, the more often people hugged, the less likely they were to get sick, even among individuals who frequently had tense interactions. In other words, both social support and hugging prevented against illness.

The same lead researcher has previously shown that the more diverse types of social ties a person has, such as with friends, family, coworkers, and community, the less susceptible to colds they are. But relationships impact more than a runny nose. On the extreme end, social connectedness seems to play a role in preventing against death. For instance, researchers in Sweden found that the otherwise robust association between job strain and mortality risk disappeared among men high in social support. In fact, low levels of social support can increase the risk for premature death more than commonly known factors like smoking or alcohol consumption, according to a review paper that examined data for over 300,000 people around the world. It’s no surprise, then, that the World Health Organization identifies social networks as a primary determinant of health.

Interestingly, social support may be beneficial for the giver as well as the receiver. Researchers at UCLA scanned participants’ brains while their romantic partners were receiving electric shocks next to them. If the participants held their partners’ hand during the experiment, their brain regions associated with fear attenuation were activated. This finding indicates that offering social support through physical touch better enabled them to cope with the stressful experience.

On the flip side, loneliness and having a small social network correspond with a lower antibody response to the influenza vaccine, compared to feeling a strong sense of social connection. Socially isolated patients with coronary artery disease have lower survival rates than socially connected patients, even after controlling for demographics, disease severity, and psychological distress. One in three individuals is chronically lonely and therefore twice as likely to say they have poor health. This is especially alarming given that the number of people who have no one to confide in tripled between 1985 and 2004, putting a large portion of the population at risk for poor health.

Evidently, just as we prioritize exercise and nutrition, we ought to prioritize quality time with loved ones; just as we avoid unhealthy habits like smoking, we should make effort to avoid isolation and to counter social exclusion. And even if you don’t want to hug hundreds of strangers (although I recommend trying it), don’t underestimate the healing power of touch.