Intrapartum antibiotic prophylaxis is effective in preventing early-onset group B streptococcal disease in newborn infants, but it influences gut microbiota development. Gut microbiota composition is, in turn, associated with immune-related diseases in childhood. This study hypothesized that intrapartum antibiotic exposure is associated with immune-related diseases in childhood. We conducted a population-based cohort study of vaginally delivered children. We retrieved data on intrapartum antibiotic exposure from structured electronic medical records and obtained outcome data on childhood autoimmune, allergic, and obstructive airway diseases from comprehensive national registers. We used Cox regression analysis with adjustment for maternal and neonatal covariates and regarded death as a competing risk in the analyses. The study population comprised 45,575 vaginally born children of whom 9733 (21%) had been exposed to intrapartum antibiotics. Intrapartum antibiotic exposure was associated with an autoimmune disease diagnosis (adjusted hazard ratio, 1.28; 95% confidence interval, 1.02-1.62), which corresponds to 22% (95% confidence interval, 6-39) as a theoretical population-attributable fraction. Intrapartum antibiotic exposure was not associated with diagnoses of allergic (adjusted hazard ratio, 1.08; 95% confidence interval, 0.97-1.20) or obstructive airway diseases (adjusted hazard ratio, 1.04; 95% confidence interval, 0.96-1.14). Intrapartum antibiotic exposure may be associated with an increased risk for autoimmune diseases in childhood. This finding supports the efforts to develop more specific group B streptococcal disease prevention strategies in the future.