Being overweight or obese in childhood can put kids at risk for several health problems later in life, such as heart disease, sleep apnea and diabetes. Add to that list trouble in school, says a new study in the journal Child Development.

The research team looked at a nationally representative sample of more than 6,250 children who were participating in the Early Childhood Longitudinal Study-Kindergarten Cohort. The children were tracked from kindergarten through the fifth grade.

Kids who were persistently obese, beginning in kindergarten, scored lower on math tests taken starting in first grade through the end of the study period, compared with kids who were never obese. For kids who became obese later, the effects varied: boys who become obese later, like in third or fifth grade, experienced no dips in math scores. Girls who became obese later showed temporary lapses in math performance.

The findings held, even after researchers accounted for other factors that may affect kids’ weight and academic performance, like race, family income and mother’s education and employment status.

The relationship between weight and academic achievement is complicated, though. For one thing, it’s not clear whether obesity itself or some other factor underlying or related to obesity may affect how kids do in school. Previous research has found that youngsters who are obese — or think of themselves as overweight or obese — may be plagued with more sadness, loneliness and low self-esteem than their healthy-weight peers. These problems can lead to poorer social and emotional skills, which can in turn interfere with children’s performance in school.

“For school-age children, one’s social standing is quite meaningful for one’s school experience and engagement in the learning process. It’s important for kids to feel liked and capable in social situations with their peers, says lead study author Dr. Sara Gable, an associate professor in the department of nutrition and exercise physiology at the University of Missouri, Columbia.

Overweight and obese kids may be stigmatized and shunned by their classmates, which makes it hard for them to have normal peer interactions that help them develop good social skills. But it could also work the other way around: kids who have poor social skills might be passed over as playmates, which makes them more likely to be isolated and depressed, upping their risk of obesity.

When it comes down to it, the study’s findings — along with a growing body of research on weight and child development — suggest that being heavy in childhood may have far-reaching and long-lasting consequences, beyond struggles in math class or even risk factors for disease. Gable urges parents and school administrators to focus not only grades, but also on kids’ physical fitness and, importantly, the social and emotional development of children with weight problems.