IMPORTANCE Allergic diseases are prevalent in childhood. Early exposure to medications that can alter the microbiome, including acid-suppressive medications and antibiotics, may influence the likelihood of allergy. OBJECTIVE To determine whether there is an association between the use of acid-suppressive medications or antibiotics in the first 6 months of infancy and development of allergic diseases in early childhood. DESIGN, SETTING, AND PARTICIPANTS A retrospective cohort study was conducted in 792 130 children who were Department of Defense TRICARE beneficiaries with a birth medical record in the Military Health System database between October 1, 2001, and September 30, 2013, with continued enrollment from within 35 days of birth until at least age 1 year. Children who had an initial birth stay of greater than 7 days or were diagnosed with any of the outcome allergic conditions within the first 6 months of life were excluded from the study. Data analysis was performed from April 15, 2015, to January 4, 2018. EXPOSURES Exposures were defined as having any dispensed prescription for a histamine-2 receptor antagonist (H 2 RA), proton pump inhibitor (PPI), or antibiotic. MAIN OUTCOMES AND MEASURES The main outcome was allergic disease, defined as the presence of food allergy, anaphylaxis, asthma, atopic dermatitis, allergic rhinitis, allergic conjunctivitis, urticaria, contact dermatitis, medication allergy, or other allergy. RESULTS Of 792 130 children (395 215 [49.9%] girls) included for analysis, 60 209 (7.6%) were prescribed an H 2 RA, 13 687 (1.7%) were prescribed a PPI, and 131 708 (16.6%) were prescribed an antibiotic during the first 6 months of life. Data for each child were available for a median of 4.6 years. Adjusted hazard ratios (aHRs) in children prescribed H 2 RAs and PPIs, respectively, were 2.18 (95% CI, 2.04-2.33) and 2.59 (95% CI, 2.25-3.00) for food allergy, 1.70