The impact of mother-infant microbiota on neurodevelopment is an area of interest, but longitudinal studies are scarce. Using a cohort of 520 families from the Jiangsu birth cohort in China, we reveal that the maternal gut microbiota during early pregnancy play a substantial role, accounting for 3.34% of the variance in offspring neurodevelopmental scores. This contribution is notably higher than the 1.24% attributed to the infants’ own microbiota at 1 year of age, underscoring the significant influence of maternal gut health on early child development. Remarkably, an elevation in maternal Bifidobacterium pseudocatenulatum is linked to decreased cognitive scores, whereas an enrichment of Bifidobacterium longum at 1 year of age is associated with higher cognitive scores. Furthermore, we find that maternal B. pseudocatenulatum is linked to the heterolactic fermentation metabolic pathway, while infant B. longum is associated with the Bifidobacterium shunt pathway. In summary, our analysis implies that maternal and infant gut microbiota play a distinct role in neurodevelopment, suggesting potential strategies for improving neurodevelopmental outcomes during early pregnancy or infant development by targeting gut microbiota composition.