ObjectiveGut microbiota alterations are associated with obesity. Early exposure to medications, including acid suppressants and antibiotics, can alter gut biota and may increase the likelihood of developing obesity. We investigated the association of antibiotic, histamine-2 receptor antagonist (H2RA) and proton pump inhibitor (PPI) prescriptions during early childhood with a diagnosis of obesity.DesignWe performed a cohort study of US Department of Defense TRICARE beneficiaries born from October 2006 to September 2013. Exposures were defined as having any dispensed prescription for antibiotic, H2RA or PPI medications in the first 2 years of life. A single event analysis of obesity was performed using Cox proportional hazards regression.Results333 353 children met inclusion criteria, with 241 502 (72.4%) children prescribed an antibiotic, 39 488 (11.8%) an H2RA and 11 089 (3.3%) a PPI. Antibiotic prescriptions were associated with obesity (HR 1.26; 95% CI 1.23 to 1.28). This association persisted regardless of antibiotic class and strengthened with each additional class of antibiotic prescribed. H2RA and PPI prescriptions were also associated with obesity, with a stronger association for each 30-day supply prescribed. The HR increased commensurately with exposure to each additional medication group prescribed.ConclusionsAntibiotics, acid suppressants and the combination of multiple medications in the first 2 years of life are associated with a diagnosis of childhood obesity. Microbiota-altering medications administered in early childhood may influence weight gain.