Background Varenicline is an effective pharmacotherapy to aid smoking cessation. However, its use is limited by continuing concerns about possible associated risks of serious adverse cardiovascular and neuropsychiatric events. The aim of this study was to investigate whether use of varenicline is associated with such events. Methods In this retrospective cohort study, we used data from patients included in the validated QResearch database, which holds data from 753 National Health Service general practices across England. We identified patients aged 18-100 years (registered for longer than 12 months before data extraction) who received a prescription of nicotine replacement treatment (NRT; reference group), bupropion, or varenicline. We excluded patients if they had used one of the drugs during the 12 months before the start date of the study, had received a prescription of a combination of these drugs during the follow-up period, or were temporary residents. We followed patients up for 6 months to compare incident cardiovascular (ischaemic heart disease, cerebral infarction, heart failure, peripheral vascular disease, and cardiac arrhythmia) and neuropsychiatric (depression and self-harm) events using Cox proportional hazards models, adjusted for potential confounders (primary outcomes). Findings We identified 164 766 patients who received a prescription (106 759 for nicotine replacement treatment; 6557 for bupropion; 51 450 for varenicline) between Jan 1, 2007, and June 30, 2012. Neither bupropion nor varenicline showed an increased risk of any cardiovascular or neuropsychiatric event compared with NRT (all hazard ratios [HRs] less than 1). Varenicline was associated with a significantly reduced risk of ischaemic heart disease (HR 0.80 [95% CI 0.72-0.87]), cerebral infarction (0.62 [0.52-0.73]), heart failure (0.61 [0.45-0.83]), arrhythmia (0.73 [0.60-0.88]), depression (0.66 [0.63-0.69]), and self-harm (0.56 [0.46-0.68]). Interpretation Varenicline does not seem to be associated with an increased risk of documented cardiovascular events, depression, or self-harm when compared with NRT. Adverse events that do not come to attention of general practitioners cannot be excluded. These findings suggest an opportunity for physicians to prescribe varenicline more broadly, even for patients with comorbidities, thereby helping more smokers to quit successfully than do at present. Open Access article published under the terms of CC BY.