Background: We aimed to assess efficacy and safety, with a special focus on cardiovascular safety, of the novel dual GIP and GLP-1 receptor agonist tirzepatide versus insulin glargine in adults with type 2 diabetes and high cardiovascular risk inadequately controlled on oral glucose-lowering medications. Methods: This open-label, parallel-group, phase 3 study was done in 187 sites in 14 countries on five continents. Eligible participants, aged 18 years or older, had type 2 diabetes treated with any combination of metformin, sulfonylurea, or sodium-glucose co-transporter-2 inhibitor, a baseline glycated haemoglobin (HbA1c) of 7·5–10·5% (58–91 mmol/mol), body-mass index of 25 kg/m2 or greater, and established cardiovascular disease or a high risk of cardiovascular events. Participants were randomly assigned (1:1:1:3) via an interactive web-response system to subcutaneous injection of either once-per-week tirzepatide (5 mg, 10 mg, or 15 mg) or glargine (100 U/mL), titrated to reach fasting blood glucose of less than 100 mg/dL. The primary endpoint was non-inferiority (0·3% non-inferiority boundary) of tirzepatide 10 mg or 15 mg, or both, versus glargine in HbA1c change from baseline to 52 weeks. All participants were treated for at least 52 weeks, with treatment continued for a maximum of 104 weeks or until study completion to collect and adjudicate major adverse cardiovascular events (MACE). Safety measures were assessed over the full study period. This study was registered with ClinicalTrials.gov, NCT03730662. Findings: Patients were recruited between Nov 20, 2018, and Dec 30, 2019. 3045 participants were screened, with 2002 participants randomly assigned to tirzepatide or glargine. 1995 received at least one dose of tirzepatide 5 mg (n=329, 17%), 10 mg (n=328, 16%), or 15 mg (n=338, 17%), or glargine (n=1000, 50%), and were included in the modified intention-to-treat population. At 52 weeks, mean HbA1c changes with tirzepatide were −2·43% (SD 0·05) with 10 mg and −2·58% (0·05) with 15 mg, versus −1·44% (0·03) with glargine. The estimated treatment difference versus glargine was −0·99% (multiplicity adjusted 97·5% CI −1·13 to −0·86) for tirzepatide 10 mg and −1·14% (−1·28 to −1·00) for 15 mg, and the non-inferiority margin of 0·3% was met for both doses. Nausea (12–23%), diarrhoea (13–22%), decreased appetite (9–11%), and vomiting (5–9%) were more frequent with tirzepatide than glargine (nausea 2%, diarrhoea 4%, decreased appetite <1%, and vomiting 2%, respectively); most cases were mild to moderate and occurred during the dose-escalation phase. The percentage of participants with hypoglycaemia (glucose <54 mg/dL or severe) was lower with tirzepatide (6–9%) versus glargine (19%), particularly in participants not on sulfonylureas (tirzepatide 1–3% vs glargine 16%). Adjudicated MACE-4 events (cardiovascular death, myocardial infarction, stroke, hospitalisation for unstable angina) occurred in 109 participants and were not increased on tirzepatide compared with glargine (hazard ratio 0·74, 95% CI 0·51–1·08). 60 deaths (n=25 [3%] tirzepatide; n=35 [4%] glargine) occurred during the study. Interpretation: In people with type 2 diabetes and elevated cardiovascular risk, tirzepatide, compared with glargine, demonstrated greater and clinically meaningful HbA1c reduction with a lower incidence of hypoglycaemia at week 52. Tirzepatide treatment was not associated with excess cardiovascular risk. Funding: Eli Lilly and Company.