Our primary objective was to estimate smoking prevalence and prescribing rates of varenicline and nicotine replacement therapy (NRT) in people with and without general practitioner (GP)-recorded dementia. Our secondary objective was to assess and compare quit rates of smokers with versus without GP-recorded dementia who were prescribed varenicline or NRT for smoking cessation.A retrospective cohort study based on the analysis of electronic medical records within the Clinical Practice Research Datalink (2007-2015).683 general practices in England.People with and without GP-recorded dementia, aged 18 years and have a code indicating that they are a current smoker.Index prescription of varenicline or NRT (from 1 September 2006).The primary outcomes were smoking prevalence and prescribing rates of varenicline and NRT (2007-2015). The secondary outcome was smoking cessation at 2 years.Age and sex-standardised prevalence of smoking was slightly higher in people with GP-recorded dementia than in those without. There were 235 314 people aged 18 years and above prescribed NRT or varenicline. Among smokers with GP-recorded dementia (N=447), 409 were prescribed NRT and 38 varenicline. Smokers with GP-recorded dementia were 74% less likely (95% CI 64% to 82%) to be prescribed varenicline than NRT, compared with smokers without GP-recorded dementia. Compared with people without GP-recorded dementia, people with GP-recorded dementia had consistently lower prescribing rates of varenicline from 2007 to 2015. Two years after prescription, there was no clear evidence for a difference in the likelihood of smoking cessation after prescription of these medications between individuals with and without dementia (OR 1.0, 95% CI 0.8 to 1.2).Between 2007 and 2015, people with GP-recorded dementia were less likely to be prescribed varenicline than those without dementia. Quit rates following prescription of either NRT or varenicline were similar in those with and without dementia.