Were you the cool kid in high school? Adolescent popularity may take a toll on your mental health later on, according to a new study.

A group of researchers from the University of Virginia recently conducted a study, which was published in Child Development, to determine how teenage relationships can affect adulthood over time.

To do so, they examined 169 racially and socioeconomically diverse individuals over a 10-year period starting at age 15. They assessed their mental health by surveying them annually on their friendships, anxiety, social acceptance and symptoms of depression. They also checked in with participants’ close friends and peers to measure quality of popularity and friendship.

They defined popularity as the number of peers in the teen’s grade who ranked them as someone they’d hang out with. And high-quality friendships were defined as close friendships that had a degree of attachment and intimate exchanges.

Scientists found that those who had close-knit relationships at age 15 had a better overall well-being at age 25. Those individuals reported lower social anxiety, increased self-worth and fewer symptoms of depression.

On the other hand, those who were popular in school reported higher levels of social anxiety at age 25.

“Our study affirms that forming strong close friendships is likely one of the most critical pieces of the teenage social experience,” Joseph Allen, lead researcher, said in a statement. “Being well-liked by a large group of people cannot take the place of forging deep, supportive friendships. And these experiences stay with us, over and above what happens later.”

While scientists noted that their study was relatively small and did not factor in an individual’s personal characteristics, they believe their findings reveal important information about the significance of fostering relationships.

“As technology makes it increasingly easy to build a social network of superficial friends,” Allen said, “focusing time and attention on cultivating close connections with a few individuals should be a priority.”