Substantial concerns have been raised about the neuropsychiatric safety of the smoking cessation medications varenicline and bupropion. Their efficacy relative to nicotine patch largely relies on indirect comparisons, and there is limited information on safety and efficacy in smokers with psychiatric disorders. We compared the relative neuropsychiatric safety risk and efficacy of varenicline and bupropion with nicotine patch and placebo in smokers with and without psychiatric disorders.We did a randomised, double-blind, triple-dummy, placebo-controlled and active-controlled (nicotine patch; 21 mg per day with taper) trial of varenicline (1 mg twice a day) and bupropion (150 mg twice a day) for 12 weeks with 12-week non-treatment follow-up done at 140 centres (clinical trial centres, academic centres, and outpatient clinics) in 16 countries between Nov 30, 2011, and Jan 13, 2015. Participants were motivated-to-quit smokers with and without psychiatric disorders who received brief cessation counselling at each visit. Randomisation was computer generated (1:1:1:1 ratio). Participants, investigators, and research personnel were masked to treatment assignments. The primary endpoint was the incidence of a composite measure of moderate and severe neuropsychiatric adverse events. The main efficacy endpoint was biochemically confirmed continuous abstinence for weeks 9-12. All participants randomly assigned were included in the efficacy analysis and those who received treatment were included in the safety analysis. The trial is registered at ClinicalTrials.gov (number NCT01456936) and is now closed.8144 participants were randomly assigned, 4116 to the psychiatric cohort (4074 included in the safety analysis) and 4028 to the non-psychiatric cohort (3984 included in the safety analysis). In the non-psychiatric cohort, 13 (1·3%) of 990 participants reported moderate and severe neuropsychiatric adverse events in the varenicline group, 22 (2·2%) of 989 in the bupropion group, 25 (2·5%) of 1006 in the nicotine patch group, and 24 (2·4%) of 999 in the placebo group. The varenicline-placebo and bupropion-placebo risk differences (RDs) for moderate and severe neuropsychiatric adverse events were -1·28 (95% CI -2·40 to -0·15) and -0·08 (-1·37 to 1·21), respectively; the RDs for comparisons with nicotine patch were -1·07 (-2·21 to 0·08) and 0·13 (-1·19 to 1·45), respectively. In the psychiatric cohort, moderate and severe neuropsychiatric adverse events were reported in 67 (6·5%) of 1026 participants in the varenicline group, 68 (6·7%) of 1017 in the bupropion group, 53 (5·2%) of 1016 in the nicotine patch group, and 50 (4·9%) of 1015 in the placebo group. The varenicline-placebo and bupropion-placebo RDs were 1·59 (95% CI -0·42 to 3·59) and 1·78 (-0·24 to 3·81), respectively; the RDs versus nicotine patch were 1·22 (-0·81 to 3·25) and 1·42 (-0·63 to 3·46), respectively. Varenicline-treated participants achieved higher abstinence rates than those on placebo (odds ratio [OR] 3·61, 95% CI 3·07 to 4·24), nicotine patch (1·68, 1·46 to 1·93), and bupropion (1·75, 1·52 to 2·01). Those on bupropion and nicotine patch achieved higher abstinence rates than those on placebo (OR 2·07 [1·75 to 2·45] and 2·15 [1·82 to 2·54], respectively). Across cohorts, the most frequent adverse events by treatment group were nausea (varenicline, 25% [511 of 2016 participants]), insomnia (bupropion, 12% [245 of 2006 participants]), abnormal dreams (nicotine patch, 12% [251 of 2022 participants]), and headache (placebo, 10% [199 of 2014 participants]). Efficacy treatment comparison did not differ by cohort.The study did not show a significant increase in neuropsychiatric adverse events attributable to varenicline or bupropion relative to nicotine patch or placebo. Varenicline was more effective than placebo, nicotine patch, and bupropion in helping smokers achieve abstinence, whereas bupropion and nicotine patch were more effective than placebo.Pfizer and GlaxoSmithKline.