Background: Febuxostat and allopurinol are urate-lowering therapies used to treat patients with gout. Following concerns about the cardiovascular safety of febuxostat, the European Medicines Agency recommended a post-licensing study assessing the cardiovascular safety of febuxostat compared with allopurinol. Methods: We did a prospective, randomised, open-label, blinded-endpoint, non-inferiority trial of febuxostat versus allopurinol in patients with gout in the UK, Denmark, and Sweden. Eligible patients were 60 years or older, already receiving allopurinol, and had at least one additional cardiovascular risk factor. Those who had myocardial infarction or stroke in the previous 6 months or who had severe congestive heart failure or severe renal impairment were excluded. After a lead-in phase in which allopurinol dose was optimised towards achieving a serum urate concentration of less than 0·357 mmol/L (<6 mg/dL), patients were randomly assigned (1:1, with stratification according to previous cardiovascular events) to continue allopurinol (at the optimised dose) or start febuxostat at 80 mg/day, increasing to 120 mg/day if necessary to achieve the target serum urate concentration. The primary outcome was a composite of hospitalisation for non-fatal myocardial infarction or biomarker-positive acute coronary syndrome; non-fatal stroke; or cardiovascular death. The hazard ratio (HR) for febuxostat versus allopurinol in a Cox proportional hazards model (adjusted for the stratification variable and country) was assessed for non-inferiority (HR limit 1·3) in an on-treatment analysis. This study is registered with the EU Clinical Trials Register (EudraCT 2011-001883-23) and ISRCTN (ISRCTN72443728) and is now closed. Findings: From Dec 20, 2011, to Jan 26, 2018, 6128 patients (mean age 71·0 years [SD 6·4], 5225 [85·3%] men, 903 [14·7%] women, 2046 [33·4%] with previous cardiovascular disease) were enrolled and randomly allocated to receive allopurinol (n=3065) or febuxostat (n=3063). By the study end date (Dec 31, 2019), 189 (6·2%) patients in the febuxostat group and 169 (5·5%) in the allopurinol group withdrew from all follow-up. Median follow-up time was 1467 days (IQR 1029–2052) and median on-treatment follow-up was 1324 days (IQR 870–1919). For incidence of the primary endpoint, on-treatment, febuxostat (172 patients [1·72 events per 100 patient-years]) was non-inferior to allopurinol (241 patients [2·05 events per 100 patient-years]; adjusted HR 0·85 [95% CI 0·70–1·03], p<0·0001). In the febuxostat group, 222 (7·2%) of 3063 patients died and 1720 (57·3%) of 3001 in the safety analysis set had at least one serious adverse event (with 23 events in 19 [0·6%] patients related to treatment). In the allopurinol group, 263 (8·6%) of 3065 patients died and 1812 (59·4%) of 3050 had one or more serious adverse events (with five events in five [0·2%] patients related to treatment). Randomised therapy was discontinued in 973 (32·4%) patients in the febuxostat group and 503 (16·5%) patients in the allopurinol group. Interpretation: Febuxostat is non-inferior to allopurinol therapy with respect to the primary cardiovascular endpoint, and its long-term use is not associated with an increased risk of death or serious adverse events compared with allopurinol. Funding: Menarini, Ipsen, and Teijin Pharma Ltd.