Overweight children often become obese adults, with attendant problems such as heart disease, diabetes and cancer.
But a new study suggests there are "critical windows" where that path to weight gain can be changed.
The study, involving more than 2,700 Finnish adults, found what many studies have shown before: Childhood body mass index, or BMI, is a good predictor of adulthood obesity.
People who became obese as adults tended to already be heavier than their peers by the age of 6. That suggests, the researchers said, that early childhood is a key period for preventing obesity later on.
But the findings also point to a "second critical window," said lead study author Marie-Jeanne Buscot, a postdoctoral researcher at the University of Tasmania in Australia.
The teenage years appeared vital, too, the study found.
That's because not everyone who was heavy as a young child became an obese adult. Those who didn't were able to slow their weight gain down by early adulthood: Among girls who avoided obesity, weight gain plateaued by age 16, on average. Among boys, that happened around age 21.
In contrast, young people who remained obese did not see their weight gain slow until they were 25, on average. The situation was similar for normal-weight kids who became obese adults; their weight gain hit a plateau around age 30.
Researchers have known that BMI -- a ratio of height to weight used to measure overweight or obesity -- in early childhood is strongly linked to adulthood obesity, Buscot explained. This study shows the importance of kids' weight-gain "trajectory" she said.
"It is not only the time before age 6, but also the rate at which children gain weight across the entire period of childhood that is important," Buscot said.
The findings, published online Dec. 19 in the journal Pediatrics, are based on 31 years of data for 2,717 adults in Finland. All had their BMI measured up to eight times between childhood and adulthood.
Most of the study group had a normal BMI in childhood and were not obese as adults. But 5 percent were heavy as kids and obese as adults, while 15 percent became obese only in adulthood.
A smaller group -- about 3 percent -- had a high BMI in childhood, but were not obese in adulthood.
It was that group, the study found, that showed an early slowdown in weight gain.
They hit a plateau even earlier than what's typical for kids with a healthy weight, Buscot said. In this study, normal-weight girls plateaued around age 17, while boys' weight gain did not slow down until around age 24.
The study is useful because it followed young people for such a long period of time, according to Cynthia Ogden, a researcher at the U.S. Centers for Disease Control and Prevention. She cowrote an editorial published with the findings.
"It's very important to understand childhood BMI trajectories," Ogden said.
At the same time, she added, weight gain in adulthood is clearly still important: Research has shown that about 70 percent of obese adults were normal-weight as kids.
How did some overweight kids manage to change their weight trajectory? The study cannot say.
But in general, kids will maintain a healthy weight when they get enough exercise and the whole family eats a balanced diet, according to the CDC.
The agency says kids should get at least an hour of physical activity on most days of the week -- anything from jumping rope and playing tag, to soccer and dance classes.
As for diet, the CDC says parents should limit added sugar -- including sweetened drinks -- and instead give kids plenty of fruits and vegetables, whole grains, dairy, and fish, beans and lean meat for protein.
The CDC has plenty of advice on healthy childhood weight.
SOURCES: Marie-Jeanne Buscot, M.Sc., Ph.D., postdoctoral researcher, Menzies Institute for Medical Research, University of Tasmania, Australia; Cynthia Ogden, Ph.D., National Center for Health Statistics, U.S. Centers for Disease Control and Prevention, Hyattsville, Md.; Dec. 19, 2017, Pediatrics, online