Antibiotics, the most commonly prescribed medications in the first two years of life, might come with the unintended consequence of childhood obesity.

By age 2, an astonishing 1 in 10 kids are obese, weighing about 36 pounds. Childhood obesity isn’t a problem with a single cause, but according to a new study published in JAMA Pediatrics, some of it could start at the doctor’s office. Researchers looked at the health records of more than 64,000 children from 2001-2013 and found that using antibiotics before age 2 was associated with an increased risk of obesity by age 5. Almost 70% of the children in the study had taken antibiotics before age 2, with an average of 2.3 courses of the drugs per child. The link was especially strong in children who took four or more courses.

MORE: This Is How Much Childhood Obesity Costs Over a Lifetime

Not all antibiotics had the same effect, however. The association was only significant with broad-spectrum antibiotics—those that wipe out different kinds of bacteria all over the body—but not narrow-spectrum antibiotics, which target only certain families of bacteria. Of the kids in the sample, 41% took broad-spectrum antibiotics at some point.

Doctors prescribe antibiotics for a host of common infections ranging from the mild, like sinus and ear infections, to the more severe, like pneumonia. Broad-spectrum antibiotics are generally recommended only when the narrow-spectrum kind won’t work, like if an infection won’t respond or if the patient has an allergy. But in practice, broad-spectrum antibiotics are being prescribed for a lot of typical childhood infections that might not even need an antibiotic at all, says study author Charles Bailey, MD, PhD of the Children’s Hospital of Philadelphia.

MORE: Antibiotics Overload Is Endangering Our Children

When parents visit the pediatrician with a sick child, they often request antibiotics to help the child feel better faster, Bailey says. “There are these non-medical pressures to use some of the broader-spectrum drugs,” he says. “But if we use broad-spectrum antibiotics a lot of the time, are we creating unintended effects down the road that we didn’t appreciate when we were sitting in the office?”

MORE: Gut Bugs—A Hidden Trigger of Obesity

One of those unintended consequences might be killing off certain kinds of beneficial bacteria in the guts of young kids at an age when their collection of bacteria—or microbiome—is thought to be especially sensitive. Studies have shown that feeding antibiotics to mice around birth alters the kind of microbes that colonize their guts, which in turn changes how they digest food, how many calories they get from their diet and how they extract energy, Bailey says. “Our worry is that we may be seeing some of the same things going on with people.”

Though obesity in early life puts a child at greater risk for obesity in adulthood, it’s still early enough to intervene, Bailey says. “Our hope is that we can find out what the risk factors are in early childhood and do a better job not just at preventing this, but of identifying the kids…who then can change their path by changing their lifestyle and changing the healthcare they get.”

Write to Mandy Oaklander at mandy.oaklander@time.com.