ObjectiveTo determine the risk of developing dementia in relation to duration of smoking cessation by using a nationwide health claims database.MethodsThis cohort study included 46,140 men aged 60 years or older from Korean National Health Insurance System – National Health Screening Cohort, a population‐based national health screening program from 2002 to 2013. The changes in smoking habit from a questionnaire during the first (2002 and 2003) and second (2004 and 2005) health examination periods, participants were divided into continual smokers, short‐term (less than 4 years) quitters, long‐term (4 years or more) quitters, and never smokers. Participants were followed‐up for 8 years from January 1, 2006 for the development of overall dementia, Alzheimer's disease, and vascular dementia.ResultsCompared to continual smokers, long‐term quitters and never smokers had decreased risk of overall dementia (hazard ratio, HR 0.86 95% CI, confidence interval 0.75–0.99 and HR: 0.81; 95% CI: 0.71–0.91, respectively). Never smokers had decreased risk of Alzheimer's disease (HR: 0.82; 95% CI: 0.70–0.96) compared to continual smokers. Finally, both long‐term quitters (HR: 0.68; 95% CI: 0.48–0.96) and never smokers (HR: 0.71; 95% CI: 0.54–0.95) had decreased risk of vascular dementia compared to continual smokers.InterpretationSmoking was associated with increased risk of dementia. Smokers who quit for a prolonged period of time may benefit from reduced risk of dementia. Therefore, smokers should be encouraged to quit in order to reduce the risk of developing dementia, especially in the elderly population who are already at risk.