Prenatal tobacco smoke exposure (TSE) and prematurity are independent risk factors for abnormal neurodevelopment. The objectives were to compare differences in Bayley-III cognitive, language, and motor scores at 2 years corrected age (CA) in 395 infants born very preterm (≤ 32 weeks gestation) with and without prenatal TSE. We performed multivariable linear regression analyses to examine associations between prenatal TSE and neurodevelopmental outcomes and a mediation analysis to estimate direct effects of prenatal TSE on outcomes and indirect effects through preterm birth. In total, 50 (12.6%) infants had prenatal TSE. Infants with prenatal TSE had lower mean [95% CI] Cognitive score (82.8 [78.6, 87.1]) vs. nonexposed infants (91.7 [90.1, 93.4]). In children with and without prenatal TSE, there were significant differences in mean [95% CI] Language scores (81.7 [76.0, 87.4] vs. 92.4 [90.2, 94.6], respectively) and mean [95% CI] Motor scores (86.5 [82.2, 90.7] vs. 93.4 [91.8, 95.0], respectively); scores remained significant after controlling for confounders. Preterm birth indirectly mediated 9.0% of the total effect of prenatal TSE on Cognitive score (P = NS). However, 91% of the remaining total effect was significant and attributable to TSE’s direct harmful effects on cognitive development (β = − 5.17 [95% CI − 9.97, − 0.38]). The significant association is largely due to TSE’s direct effect on cognitive development and not primarily due to TSE’s indirect effect on preterm birth.