There have been reports of associations between cesarean section delivery and the risk of childhood asthma, potentially mediated through changes in the gut microbiota. We followed 700 children in the Copenhagen Prospective Studies on Asthma in Childhood2010 (COPSAC2010) cohort prospectively from birth. We examined the effects of cesarean section delivery on gut microbial composition by 16S rRNA gene amplicon sequencing during the first year of life. We then explored whether gut microbial perturbations due to delivery mode were associated with a risk of developing asthma in the first 6 years of life. Delivery by cesarean section was accompanied by marked changes in gut microbiota composition at one week and one month of age, but by one year of age only minor differences persisted compared to vaginal delivery. Increased asthma risk was found in children born by cesarean section only if their gut microbiota composition at 1 year of age still retained a cesarean section microbial signature, suggesting that appropriate maturation of the gut microbiota could mitigate against the increased asthma risk associated with gut microbial changes due to cesarean section delivery.