The reported association between maternal antibiotic use and childhood obesity, if true, could change obstetric practice. However, it is unclear whether the reported association was due to antibiotics, or underlying infection or both. To examine the independent contributions of maternal infection and antibiotic use separately, we conducted a birth cohort study among Kaiser Permanente Northern California (KPNC) members. The study consisted of 145,393 mother-child dyads. The KPNC electronic medical records provided data on maternal infections, antibiotic use during pregnancy, and longitudinal anthropometric measurements throughout childhood. Obesity was defined by BMI using CDC criteria. Mixed effects logistic regression for repeated measurements was used to analyze multiple BMI measurements per child (five measurements per child on average). After controlling for confounders using propensity score methodology, there was no increased risk associated with maternal antibiotic use during pregnancy once underlying infection was controlled for: OR = 0.97 (95% CI: 0.92-1.01). There was also no association with timing of use or use of broad-spectrum antibiotics, nor a dose-response relationship. In contrast, maternal untreated infection (without antibiotic use) during pregnancy was associated with a statistically significant risk of childhood obesity compared with mothers without infection: odds ratio (OR) = 1.09 (95% confidence interval (CI): 1.03-1.16). The association was stronger for GBS positive infection (OR = 1.16) than GBS negative infections (OR = 1.08). These results were further confirmed by a discordant sibling study. This discordant sibling study allowed additional control of unmeasured confounders including genetic, maternal intrauterine, and familiar factors. The consistent findings from this sibling study enhances the reproducibility of our findings. It is maternal infection, NOT antibiotic use, during pregnancy that is associated with increased risk of childhood obesity. While use of antibiotics should always be judicious, in the context of preventing childhood obesity, the focus should be on reducing maternal infections during pregnancy.