Want to live a longer, healthier life? All you need is a friend or two. Male friendships can improve health by boosting each buddy’s ability to cope with stress, a known killer.

Social activities raise the level of the hormone oxytocin in the brain. Oxytocin, often called the “love” or “cuddle” hormone in recent years, not only leads people to form bonds with each other; it also increases resilience in stressful situations. This hormone bump has been observed in both non-sexual and romantic relationships.

Most Amazing Animal Friendships: Photos

In a study on rats, researchers at the University of California, Berkeley found that the rodents exhibited prosocial behaviors when confronted with a mild stress.

Under normal circumstances, rats kept in the same quarters are competitive toward one another, quibbling over resources. Take away their water for a while and then reintroduce it, and the rats become “like a bunch of thirsty 7-year-olds who don’t know how to stand in line yet,” lead author Elizabeth Kirby explains in a statement.

When the rats had to endure stressful circumstances, which in the case of this experiment meant being restrained for a few hours, the rodents reacted completely differently to the introduction of resource scarcity. They shared their water evenly and didn’t display aggressive behavior. A minor hardship brought the rats together with their cagemates. They had higher oxytocin levels and even huddled together more.

Video: Imaginary Friends Make You Awesome

Severe stress, however, provoked an entirely different reaction. When exposed to a potentially life-threatening stressor, in this case the smell of fox urine while they were restrained, the rats became antisocial, often sitting alone in a corner and ratcheting up the aggression against their cagemates. They display behavioral signs similar to those of people suffering from post-traumatic stress disorder (PTSD), the researchers found. The more stressful situation also led to changes in the brain. Instead of getting an oxytocin bump, the receptor levels decreased.

Previous research also supports the notion that friendships are important to healthier living. In fact a study published in January determined that social networks are up there with diet and exercise in terms of their ability to influence health throughout our lifetimes. The more social ties people establish and the earlier those relationships are formed, the better the health outcomes.

For their study, researchers at the University of North Carolina used a number of health metrics, such as waist circumference, body mass index and blood pressure, all of which have been linked to life-threatening conditions such as heart disease, cancer and stroke, and compared those against social integration. Across age groups, individuals with more social relationships were consistently and significantly healthier than their peers. In the case of blood pressure, social isolation is potentially even more harmful than diabetes in old age, based on the researchers’ findings.