Hugging feels good for a reason — it’s a form of social interaction and physical affection that can provide people with a sense of security, positive feelings, and improved health.

Now, a new study out of Carnegie Mellon University (CMU) has discovered that hugs can in fact help fight off illnesses and infections — and boost your immune system. The study, led by Sheldon Cohen, who is the Robert E. Doherty University Professor of Psychology at CMU’s Dietrich College of Humanities and Social Sciences, was published in Psychological Science. It found that people who had greater social support and experienced more hugs were more protected from stress and stress-related infections. And those who did get sick but also experienced more hugs, experienced less severe symptoms.

“We know that people experiencing ongoing conflicts with others are less able to fight off cold viruses,” Cohen said in the press release. “We also know that people who report having social support are partly protected from the effects of stress on psychological states, such as depression and anxiety. We tested whether perceptions of social support are equally effective in protecting us from stress-induced susceptibility to infection and also whether receiving hugs might partially account for those feelings of support and themselves protect a person against infection.”

Researchers examined 404 healthy adults who reported their amount of interpersonal conflicts and number of hugs received. The participants were then exposed to a common cold virus, and then examined as the illness progressed. The results, the researchers found, were proof that social support can actually act as a form of protection or buffer against viruses and conflicts. People who received more hugs experienced less severe illness symptoms than those who didn’t receive as many.

“This suggests that being hugged by a trusted person may act as an effective means of conveying support and that increasing the frequency of hugs might be an effective means of reducing the deleterious effects of stress,” Cohen said in the press release. “The apparent protective effect of hugs may be attributable to the physical contact itself or to hugging being a behavioral indicator of support and intimacy. Either way, those who receive more hugs are somewhat more protected from infection.”

So next time you’re worried about coming off as weird when you hug someone for too long — think twice, and remember that hugging can benefit you both, and protect you from stress and sickness.