To assess the association between taking antibiotics in pregnancy and the occurrence of infections in children at four years of age. We studied children who participated in the follow-up of the birth cohort Generation XXI, Porto-Portugal, at the age of four years. We evaluated the associations between the use of antibiotics by the mother at any time in pregnancy with the occurrence of infections. Data were analysed using logistic regression, controlling for potential confounding variables. We studied 7459 children (50.7% boys). The use of antibiotics at any stage of pregnancy, and not only in the third trimester, was associated with the occurrence of tonsillitis at four years, even after controlling for potential confounders (OR 1.19, 95% CI 1.03-1.38). Other infections did not show association. Maternal use of antibiotics during pregnancy was associated with an increased risk of tonsillitis reported at four years of age. Antibiotics could favour the potential transmission of an unfavourable microbiome from mother to child. ©2021 Foundation Acta Paediatrica. Published by John Wiley & Sons Ltd.