There’s growing evidence of the long-term health problems linked to too much exposure to antibiotics. Not only are the drugs becoming less effective as bacteria become resistant to existing medicines, but they are changing our bodies, particular those of young children, in potentially unhealthy ways.

In the largest and longest study so far looking at how antibiotic exposure affects body mass index (BMI), researchers found that the more doses and the longer children are exposed to antibiotics, the more likely they are to retain weight gained and to gain more weight over time.

MORE: Antibiotics Are Linked To Type-2 Diabetes

Led by Brian Schwartz, professor of environmental health sciences at the Johns Hopkins Bloomberg School of Public Health, the team looked at electronic health records of 142,824 children between the ages of three and 18 years. They broke down antibiotic prescriptions by what effect they had on BMI—whether it was temporary, or reversible and the weight that was gained associated with the drugs was lost within a year, or whether the effects were more long lasting, and the weight didn’t come off.

Reporting in the International Journal of Obesity, they found that having any antibiotic prescription in the past year (most received two prescriptions on average) before children’s BMI was measured resulted in a weight gain, but that this weight was lost soon after the medication was stopped. When the researchers looked at the cumulative effects of the drugs, however, they found that compared to children who did not take any antibiotics, those who did were more likely to gain and hold onto weight, and eventually even gain more weight by the time they were 18 years old.

MORE: There’s Yet Another Downside To Overusing Antibiotics

“The more antibiotics you get, the stronger the effect,” says Schwartz. “And this effect seems to get larger as you get older.”

Overall, using antibiotics contributed to anywhere from 1.6 pounds to 3.3 pounds of weight gain during childhood.

Schwartz says that the drugs are likely having this lasting effect on weight through the microbiome, or the population of bacteria living in the gut. There is growing evidence that changing the makeup of these “good” bacteria, which help to digest food and maintain the health of the immune system and intestinal tract, may affect things like body weight. Antibiotics may wipe out existing microbiomes and replace them with other, less beneficial bugs, and that may adversely affect weight. The fact that prolonged and continued exposure to antibiotics results in additional weight gain seems to support this theory. “A single antibiotic can wipe out an entire intestinal microbiome,” says Schwartz. “If antibiotics are infrequent, then the microbiome can recover. But if there are excessive antibiotics, then the impacts on the microbiome can last, and the ecology of the bacteria in the intestinal tract changes and doesn’t go back to what it was before.”

MORE: This Chart Shows How Hard It Is to End Childhood Obesity

While his team accounted for other factors that could affect children’s weight, they could not factor in the potential influence of the children’s mother’s microbiome during pregnancy. Some evidence suggests that babies born via Cesarean section, and therefore not exposed to the mother’s vaginal microbes, tend to be heavier and more susceptible to certain immune conditions such as allergies and asthma.

The results, says Schwartz, stress the need to use antibiotics sparingly and only when absolutely necessary. Not doing so could continue to put more children at risk of obesity, even if they’re eating right and exercising.

Get our Health Newsletter. Sign up to receive the latest health and science news, plus answers to wellness questions and expert tips. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.