Many teens may feel like being popular is the ultimate goal in high school, but the lasting benefits of having a few close friends appear to outweigh those of having lots of superficial ones.

That's the takeaway from a new study that finds the types of friendships people form in high school offers a clue to their mental health into early adulthood.

Researchers from the University of Virginia followed 169 individuals over a 10-year period, from the time they were 15 to age 25.

Get Breaking News Delivered to Your Inbox

Each year, the participants answered questions for the researchers about their friendships, who their closest friends were and their feelings on anxiety, social acceptance, self-worth, and symptoms of depression. The teens' close friends were also interviewed about their friendships.

The researchers defined high-quality friendships as close relationships with a degree of attachment and support and those that allow for intimate exchanges. Popularity, on the other hand, was defined by the number of peers in the participants' grade who ranked them as someone desirable to spend time with.

The findings, published in the journal Child Development, showed that adolescents who prioritized tight-knit friendships at age 15 had lower social anxiety, increased sense of self-worth, and fewer symptoms of depression by the time they reached age 25 than their peers.

In contrast, those who were considered popular in high school had higher levels of social anxiety as adults.

"Our research found that the quality of friendships during adolescence may directly predict aspects of long-term mental and emotional health," study leader Rachel K. Narr, a Ph.D. candidate in clinical psychology at the University of Virginia, said in a statement. "High school students with higher-quality best friendships tended to improve in several aspects of mental health over time, while teens who were popular among their peers during high school may be more prone to social anxiety later in life."

Interestingly, the researchers note that neither having close friendships nor being popular appeared to affect teens' mental health in the short term. Rather, the apparent impact was only seen later on.

The authors say a likely reason for the lasting effects of close friendships in high school is that having positive experiences with friends at this age help bolster positive feelings about oneself during a stage where personal identity is being developed.

Joseph Allen, the Hugh P. Kelly professor of psychology at the University of Virginia and a co-author of the study, said the research demonstrates that "forming strong close friendships is likely one of the most critical pieces of the teenage social experience."

"Being well-liked by a large group of people cannot take the place of forging deep, supportive friendships," he said. "And these experiences stay with us, over and above what happens later. As technology makes it increasingly easy to build a social network of superficial friends, focusing time and attention on cultivating close connections with a few individuals should be a priority."