These drugs, particularly if taken for lengthy periods, may alter gut microbes that have been associated with weight gain, explain the researchers.
The composition of gut bacteria (the microbiome) has been linked to various aspects of human health, including obesity. And certain drugs, such as antibiotics and acid suppressants-histamine 2 receptor antagonists (H2RA) and proton pump inhibitors (PPIs)-can alter the type and volume of bacteria in the gut.
To try and find out if exposure to these drugs in early childhood might increase the risk of obesity, the researchers looked at the medicines prescribed to 333,353 infants, whose medical records had been input into the US Military Health System database between 2006 and 2013, in the first two years of their lives.
In all, 241, 502 (72.5%) had been prescribed an antibiotic; 39,488 (just under 12%) an H2RA; and 11,089 (just over 3%) a PPI during this period. Some 5868 children were prescribed all three types of drug.
Some 46,993 (just over 14%) children became obese, of whom 9628 (11%) had not been prescribed any antibiotics or acid suppressants.
Boys, those born after a caesarean section, and those whose parents were below officer rank were more likely to become obese.
But after taking account of potentially influential factors, a prescription for antibiotics or acid suppressants was associated with a heightened risk of obesity by the age of 3--the average age at which obesity was first identified in these children.
A prescription for antibiotics was associated with a 26 per cent heightened risk of obesity. This association persisted, irrespective of antibiotic type, and strengthened with each additional class of antibiotic prescribed.
Acid suppressants were also associated with a heightened obesity risk, although to a lesser extent, and this association strengthened for each 30-day supply prescribed.
Although the largest study of its kind, it is nevertheless observational, and as such, can't establish cause. And potentially influential information on how much the children's mothers weighed, and whether they smoked or had other underlying conditions wasn't available.
And the researchers emphasise that the links between the individual, the environment, and obesity are complex, highlighting the "current difficulty of drawing clear conclusions about the interplay between exposure history, gut microbiota and propensity to develop obesity."
They add: "There is an important therapeutic role for microbiota-altering medications. The long term risks to health must be weighed against the short-term benefits."
But they also point out that over prescription of both antibiotics and acid suppressants, including in young children, is "a significant problem."