Zigy Kaluzny / Getty Images

Children who are ostracized by their peers and bullied often become depressed, but new research suggests that the relationship may work the other way around as well: children’s depressive symptoms in elementary school precede social victimization and isolation later on.

Previous studies that tried to work out whether bullying causes depression, or whether depressed kids become magnets for bullies — or whether the two problems drive each other — have produced conflicting results. However, the new study found a clear path from depressive symptoms in 4th grade to being bullied in 5th grade and rejected more widely by peers in 6th.

Researchers followed 486 children, gauging their symptoms of depression and their levels of social acceptance through confidential surveys filled out by parents, teachers and the kids themselves; the children rated themselves and their classmates. Most of the students were white, 16% were African American and 4% of Hispanic or mixed race. Half were from upper-middle-class or high-income families, a quarter were in the middle class and the rest were low income.

MORE: What if My Son Is a Bully? — What You Need to Know About Bullying

While children with symptoms of depression in 4th grade became prone to peer victimization later, the researchers found that being bullied earlier didn’t increase children’s risk of depression in later grades. The children with the highest levels of depressive symptoms in 4th grade were more likely to be bullied by 5th grade.

Children who show symptoms of depression — having low energy, social withdrawal, passive behavior, excessive crying, and having an obsessive, negative self-focus — may first be rejected by peers and then targeted by bullies.

Indeed, the findings jibe with some evolutionary theories about depression, which note that the posture and behaviors associated with depression are almost identical to the submission signals used by low status animals in hierarchical species. Bullying, meanwhile, looks similar to some of the dominance behaviors of high-ranking animals.

Therefore, the thinking goes, children with depression are not only less likable to others, but they are also visibly marked as having low status. That attracts the attention of bullies who like to prey on weaker victims who won’t fight back. It also leads other children who might previously have liked them, or at least tolerated them, to become afraid to associate with them too, because they don’t want to attract the bullies’ attention themselves and because being linked with low-status peers may reduce their own social standing.

So by 6th grade, not only are the depressed children more likely to be bullied, they’re also more likely to be rejected by the rest of their peer group. However, this effect was less strong than the connection between 4th-grade depression and 5th-grade bullying.

MORE: How Not to Raise a Bully: The Early Roots of Empathy

The authors write that the “findings suggest that depressive symptoms not only exert [immediate] adverse effects…but also interfere with the developmental maturation of relationships in ways that create longer term social difficulties.”

The researchers also note that the pathway from depression to bullying may run the other way in older grades. As socializing becomes more important in the teen years, vulnerable kids who experience social difficulties like bullying and rejection may become more likely to develop depression, or if they were previously depressed, their social problems may exacerbate their symptoms.

The authors conclude:

[E]ven subclinical levels of depressive symptoms can undermine development of peer relationships and…intervention efforts should be aimed at minimizing the adverse influence of depressive symptoms and associated deficits on these relationships.

Teaching children to be kinder to those who are already feeling low might also be something to consider.

The study was published in Child Development.

Maia Szalavitz is a health writer at TIME.com. Find her on Twitter at @maiasz. You can also continue the discussion on TIME Healthland’s Facebook page and on Twitter at @TIMEHealthland.