© 2015 Elsevier Ltd. Background: Substantial variability exists in therapeutic response and adverse effects with pharmacotherapies for tobacco dependence. Biomarkers to optimise treatment choice for individual smokers might improve treatment outcomes. We tested whether a genetically informed biomarker of nicotine clearance, the nicotine metabolite ratio (NMR; 3'-hydroxycotinine:cotinine), predicts response to nicotine patch or varenicline for smoking cessation. Methods: We undertook NMR-stratified multicentre, randomised, placebo-controlled clinical trial from Nov 16, 2010, to Sept 12, 2014, at four sites. Smokers seeking treatment were randomly assigned by baseline NMR status and study site, in blocks of 12 patients (1:1:1 ratio), to 11 weeks of placebo (placebo pill plus placebo patch), nicotine patch (active patch plus placebo pill), or varenicline (active pill plus placebo patch), plus behavioural counselling. Participants and investigators were masked to group allocation and NMR status. An intention-to-treat analysis was done. Participants were followed up for 12 months after the target quit date. The primary endpoint was biochemically verified 7 day point prevalence abstinence at the end of treatment to estimate the pharmacological effect of treatment by NMR. The trial is registered at ClinicalTrials.gov, number NCT01314001. Findings: 1246 participants (662 slow metabolisers of nicotine, 584 normal metabolisers of nicotine) were enrolled and randomly assigned to the three interventions (408 placebo, 418 nicotine patch, 420 varenicline). At end of treatment, varenicline was more efficacious than nicotine patch in normal metabolisers (OR 2·17, 95% CI 1·38-3·42; p=0·001), but not in slow metabolisers (OR 1·13, 0·74-1·71; p=0·56). In the longitudinal model including all timepoints, the NMR-by-treatment interaction was significant (ratio of odds ratios [ORR] 1·96, 95% CI 1·11-3·46; p=0·02). An NMR-by-treatment interaction showed that slow (. vs normal) metabolisers reported greater overall side-effect severity with varenicline versus placebo (β=-1·06, 95% CI -2·08 to -0·03; p=0·044). Interpretation: Treating normal metabolisers with varenicline and slow metabolisers with nicotine patch could optimise quit rates while minimising side-effects. Funding: National Institutes of Health, Canadian Institutes of Health Research, Abramson Cancer Center, Centre for Addiction and Mental Health Foundation, and Pennsylvania Department of Health.