To test the relationship between early cognitive ability and major changes in smoking habits across adulthood, and test whether educational attainment mediates these associations. Prospective observational study to examine the link between cognitive ability and smoking initiation, relapse and cessation at multiple time-points throughout adulthood in a pooled analysis of two cohorts. Great Britain 1981-2013. A total of 16 653 participants from two British cohorts; 7191 from the 1970 British Cohort Study (BCS) and 9462 from the 1958 National Child Development Study (NCDS). Participants were 52.9% female and 27.3% were smokers, 24.8% were ex-smokers and 47.9% reported never smoking. Cognitive ability was assessed at age 10years in the BCS and 11years in the NCDS. Outcomes were smoking initiation, relapse and cessation derived from changes in smoking status observed across five time-points between ages 26-42 in the BCS and six time-points between ages 23-55 in the NCDS. Educational attainment was examined as a mediating variable. Controls were age, gender, social class, self-control, psychological distress, parental smoking and a study indicator (BCS/NCDS). In adjusted regression models, a 1 standard deviation increase in cognitive ability predicted a 0.5 percentage point (95% CI=-0.9 to -0.1) reduced probability of smoking and a 2.9 percentage point (95% CI=2.1-3.7) higher probability of smoking cessation throughout adulthood, but did not change the likelihood of smoking relapse significantly. Differences in educational attainment explained approximately half the association between childhood cognitive ability and smoking initiation/cessation. Lower cognitive ability, measured in childhood before smoking is initiated, appears to predict a higher likelihood of taking up smoking and a lower likelihood of quitting in adulthood. Educational attainment appears to mediate this effect: children with higher cognitive ability tend to become more highly educated adults which, in turn, predicts lower rates of smoking initiation and increased rates of smoking cessation.