Dysbiosis of the infant gut microbiota may have long‐term health consequences. This study aimed to determine the impact of maternal intrapartum antibiotic prophylaxis (IAP) on infant gut microbiota, and to explore whether breastfeeding modifies these effects.Prospective pregnancy cohort of Canadian infants born in 2010–2012: the Canadian Healthy Infant Longitudinal Development (CHILD) Study.General community.Representative sub‐sample of 198 healthy term infants from the CHILD Study.Maternal IAP exposures and birth method were documented from hospital records and breastfeeding was reported by mothers. Infant gut microbiota was characterised by Illumina 16S rRNA sequencing of faecal samples at 3 and 12 months.Infant gut microbiota profiles.In this cohort, 21% of mothers received IAP for Group B Streptococcus prophylaxis or pre‐labour rupture of membranes; another 23% received IAP for elective or emergency caesarean section (CS). Infant gut microbiota community structures at 3 months differed significantly with all IAP exposures, and differences persisted to 12 months for infants delivered by emergency CS. Taxon‐specific composition also differed, with the genera Bacteroides and Parabacteroides under‐represented, and Enterococcus and Clostridium over‐represented at 3 months following maternal IAP. Microbiota differences were especially evident following IAP with emergency CS, with some changes (increased Clostridiales and decreased Bacteroidaceae) persisting to 12 months, particularly among non‐breastfed infants.Intrapartum antibiotics in caesarean and vaginal delivery are associated with infant gut microbiota dysbiosis, and breastfeeding modifies some of these effects. Further research is warranted to explore the health consequences of these associations.Maternal #antibiotics during childbirth alter the infant gut #microbiome.