ABSTRACTChildhood obesity is linked to maternal smoking during pregnancy. Gut microbiota may partially mediate this association and could be potential targets for intervention; however, its role is understudied. We included 1,592 infants from the Canadian Healthy Infants Longitudinal Development Cohort. Data on environmental exposure and lifestyle factors were collected prenatally and throughout the first three years. Weight outcomes were measured at one and three years of age. Stool samples collected at 3 and 12 months were analyzed by sequencing the V4 region of 16S rRNA to profile microbial compositions and magnetic resonance spectroscopy to quantify the metabolites. We showed that quitting smoking during pregnancy did not lower the risk of offspring being overweight. However, exclusive breastfeeding until the third month of age may alleviate these risks. We also reported that maternal smoking during pregnancy significantly increased Firmicutes abundance and diversity. We further revealed that Firmicutes diversity mediates the elevated risk of childhood overweight and obesity linked to maternal prenatal smoking. This effect possibly occurs through excessive microbial butyrate production. These findings add to the evidence that women should quit smoking before their pregnancies to prevent microbiome-mediated childhood overweight and obesity risk, and indicate the potential obesogenic role of excessive butyrate production in early life.