"Mean girls" might be just as hurt by their own cruelty as the people they exclude, researchers say. Engaging in social bullying causes people to feel shame and guilt and makes them feel less connected to others, a new study shows.

"In real life and in academic studies, we tend to focus on the harm done to victims in cases of social aggression," study researcher Richard Ryan, professor of clinical and social psychology at the University of Rochester, said in a statement. "This study shows that when people bend to pressure to exclude others, they also pay a steep personal cost. Their distress is different from the person excluded, but no less intense."

For the study, Ryan and his colleagues recruited 152 undergraduate students to play an online game called Cyberball, which was like a virtual game of catch between three players. The students were led to believe they were playing the game with two other real people, but the other players in the game were actually computers.

In one scenario, the computer players were programed to exclude the student participant, throwing the virtual ball back and forth only to each other for most of the game. In another setup, one computer player was programed to freeze out the other computer and the student was also told to exclude this player.

Based on surveys the students took before and after the game, the researchers found that being shunned lowered participants' mood and caused them to feel upset and angry. But those who carried out orders to ostracize others also suffered: They felt more shameful and guilty compared with other participants, and they had low scores of social relatedness and autonomy, which psychologists describe as a person's basic need to feel like she is acting based on her own values and desires.

The results suggest that ostracizing others and social bullying comes at a fairly high psychological cost.

"We are social animals at heart," the study’s leader, Nicole Legate, said in a statement. "We typically are empathetic and avoid harming others unless we feel threatened."

The research was detailed online last week in the journal Psychological Science.