A new study has found that feeling socially isolated is linked to cellular changes that weaken the immune system and increase inflammation in the body.

Ah, solitude. What feels refreshing to some can be crippling for others.

Feeling isolated from other people when we wish we weren’t isn’t just unpleasant. It’s also bad for us.

Whether it strikes late at night when we are alone, or in the form of feeling like you don’t belong in the middle of a crowded party, the sharp sting of social isolation is unmistakable.

And it’s not just in our heads; the effects of that sensation are felt deep inside our bodies, at the level of our cells and DNA.

These kinds of physiological changes, say the authors of a new study, help explain the link seen in earlier studies between social isolation and poor health. This includes an increased risk of early death among the chronically lonely.

Researchers from the University of Chicago and other institutions found that perceived social isolation — the feeling of loneliness — was associated with a weaker immune system and increased inflammation in the body.

They suggest that these changes result from the effect of loneliness on the activity of certain genes — a phenomenon called “conserved transcriptional response to adversity,” or CTRA.

These results were seen in 141 older adults who participated in the study, as well as in a group of rhesus macaques, a type of highly social monkey.

The study was published online this week in the Proceedings of the National Academy of Sciences.

Read More: Symptoms of Depression »

In earlier studies, the researchers showed that loneliness could shift the activity of genes involved in inflammation and the immune system’s response to viruses.

In the new study, researchers found that perceived social isolation and the CTRA type of gene expression were reciprocal and long-lasting.

People who showed signs of loneliness were more likely to have those kinds of gene activity changes even a year or more later.

And people with the CTRA gene expression tended to score higher on a self-reported questionnaire of loneliness used in the study, also up to a year later.

The researchers suggest that loneliness and the changes occurring at the cellular level may feed off of each other to continue the cycle of loneliness.

These changes were strictly linked to loneliness and not to stress, depression, or a person’s level of social support.

The researchers also found that lonely people and lonely monkeys both had higher levels of a type of immune system cell found in the blood called immature monocytes. These cells showed the CTRA type of gene activity.

This was accompanied by an activation of the body’s “fight-or-flight” stress response. One of the hormones involved in this response is known to stimulate the production of immature monocytes.

Adding support to loneliness as a type of stress, monkeys that were exposed to mildly stressful social conditions saw a similar jump in the number of immature monocytes.

Read More: Lack of Mental Health Services for Children Reaches ‘Crisis’ Level »

In the new study, when lonely monkeys were exposed to the simian immunodeficiency virus — the monkey version of HIV — the virus grew more quickly in the brain and blood.

These types of cellular changes may explain some of the long-term health effects of loneliness seen in previous research.

A study earlier this year by another group of researchers found that social isolation, loneliness, and living alone all increased the risk of dying early.

The researchers looked at each of these factors separately because they don’t always occur together. Some people can feel lonely even while surrounded by people. Others may prefer to be alone and never experience loneliness.

“The effect of this is comparable to obesity, something that public health takes very seriously,” study author Julianne Holt-Lunstad, Ph.D., a psychologist at Brigham Young University, said in a press release. “We need to start taking our social relationships more seriously.”

Read More: Is Technology Causing a Lifetime of Pain for Millennials? »

Most social isolation research has focused on how loneliness affects the health of older adults.

Another study earlier this year found that older adults who reported feeling lonely visited their doctor more often compared to those who weren’t lonely.

The Brigham Young University researchers, though, discovered that loneliness and social isolation were better indicators of early death in people younger than 65 years old.

As researchers probe the effects of loneliness at the cellular level, questions remain of why so many people feel lonely.

A 2006 study suggests that since 1985, Americans have become more socially isolated. They also have fewer close family and friends to talk with about important topics.

Many people have blamed the Internet and new technology for this shift in society. People who frequently go online are more distracted and disconnected from others, they say.

A 2009 report by the Pew Research Center, though, found that technology is not all that bad.

Internet users were just as likely as nonusers to visit face-to-face with their neighbors. And cell phone users and bloggers were also likely to belong to a local volunteer group.

And technology also seemed to be making people’s close circles more diverse. Regular users of social media had more people from different backgrounds than their own to communicate with.

But whatever is causing loneliness, it’s clear that there can be long-term effects on your health. And loneliness may require professional treatment in the same way as other mental health issues.