The objective was to investigate the association between early and late maternal smoking during pregnancy on offspring body mass index (BMI). We undertook a retrospective cohort study using linked records from the Women’s and Children’s Health Network in South Australia. Among a cohort of women delivering a singleton, live-born infants between January 2000 and December 2005 (n=7658), 5961 reported not smoking during pregnancy, 297 reported quitting smoking during the first trimester of pregnancy, and 1400 reported continued smoking throughout pregnancy. Trained nurses measured the height and weight of the children at preschool visits in a state-wide surveillance programme. The main outcome measure was age- and sex-specific BMI z-score. At 4 to 5 years, mean (s.d.) BMI z-score was 0.40 (1.05), 0.60 (1.07) and 0.65 (1.18) in children of mothers who reported never smoking, quitting smoking and continued smoking during pregnancy, respectively. Compared with the group of non-smokers, both quitting smoking and continued smoking were associated with an increase in child BMI z-score of 0.15 (95% confidence interval: 0.01–0.29) and 0.21 (0.13–0.29), respectively. A significant dose–response relationship was also observed between the number of cigarettes smoked per day on average during the second half of pregnancy and the increase in offspring BMI z-score (P<0.001). In conclusion, any maternal smoking in pregnancy, even if mothers quit, is associated with an increase in offspring BMI at 4 to 5 years of age.