BACKGROUND: LY3298176 is a novel dual glucose-dependent insulinotropic polypeptide (GIP) and glucagon-like peptide-1 (GLP-1) receptor agonist that is being developed for the treatment of type 2 diabetes. We aimed to examine the efficacy and safety of co-stimulation of the GLP-1 and GIP receptors with LY3298176 compared with placebo or selective stimulation of GLP-1 receptors with dulaglutide in patients with poorly controlled type 2 diabetes. METHODS: In this double-blind, randomised, phase 2 study, patients with type 2 diabetes were randomly assigned (1:1:1:1:1:1) to receive either once-weekly subcutaneous LY3298176 (1 mg, 5 mg, 10 mg, or 15 mg), dulaglutide (1·5 mg), or placebo for 26 weeks. Assignment was stratified by baseline glycated haemoglobin A1c (HbA1c), metformin use, and body-mass index (BMI). Eligible participants (aged 18-75) had type 2 diabetes for at least 6 months (HbA1c 7·0-10·5%, inclusive), that was inadequately controlled with diet and exercise alone or with stable metformin therapy, and a BMI of 23-50 kg/m2. The primary efficacy outcome was change in HbA1c from baseline to 26 weeks in the modified intention-to-treat (mITT) population (all patients who received at least one dose of study drug and had at least one postbaseline measurement of any outcome). Secondary endpoints, measured in the mITT on treatment dataset, were change in HbA1c from baseline to 12 weeks; change in mean bodyweight, fasting plasma glucose, waist circumference, total cholesterol, LDL cholesterol, HDL cholesterol, and triglycerides, and proportion of patients reaching the HbA1c target (≤6·5% and <7·0%) from baseline to weeks 12 and 26; and proportion of patients with at least 5% and 10% bodyweight loss from baseline to 26 weeks. This study is registered with ClinicalTrials.gov, number NCT03131687. FINDINGS: Between May 24, 2017, and March 28, 2018, 555 participants were assessed for eligibility, of whom 318 were randomly assigned to one of the six treatment groups. Because two participants did not receive treatment, the modified intention-to-treat and safety populations included 316 participants. 258 (81·7%) participants completed 26 weeks of treatment, and 283 (89·6%) completed the study. At baseline, mean age was 57 years (SD 9), BMI was 32·6 kg/m2 (5·9), duration from diagnosis of diabetes was 9 years (6), HbA1c was 8·1% (1·0), 53% of patients were men, and 47% were women. At 26 weeks, the effect of LY3298176 on change in HbA1c was dose-dependent and did not plateau. Mean changes from baseline in HbA1c with LY3298176 were -1·06% for 1 mg, -1·73% for 5 mg, -1·89% for 10 mg, and -1·94% for 15 mg, compared with -0·06% for placebo (posterior mean differences [80% credible set] vs placebo: -1·00% [-1·22 to -0·79] for 1 mg, -1·67% [-1·88 to -1·46] for 5 mg, -1·83% [-2·04 to -1·61] for 10 mg, and -1·89% [-2·11 to -1·67] for 15 mg). Compared with dulaglutide (-1·21%) the posterior mean differences (80% credible set) for change in HbA1c from baseline to 26 weeks with the LY3298176 doses were 0·15% (-0·08 to 0·38) for 1 mg, -0·52% (-0·72 to -0·31) for 5 mg, -0·67% (-0·89 to -0·46) for 10 mg, and -0·73% (-0·95 to -0·52) for 15 mg. At 26 weeks, 33-90% of patients treated with LY3298176 achieved the HbA1c target of less than 7·0% (vs 52% with dulaglutide, 12% with placebo) and 15-82% achieved the HbA1c target of at least 6·5% (vs 39% with dulaglutide, 2% with placebo). Changes in fasting plasma glucose ranged from -0·4 mmol/L to -3·4 mmol/L for LY3298176 (vs 0·9 mmol/L for placebo, -1·2 mmol/L for dulaglutide). Changes in mean bodyweight ranged from -0·9 kg to -11·3 kg for LY3298176 (vs -0·4 kg for placebo, -2·7 kg for dulaglutide). At 26 weeks, 14-71% of those treated with LY3298176 achieved the weight loss target of at least 5% (vs 22% with dulaglutide, 0% with placebo) and 6-39% achieved the weight loss target of at least 10% (vs 9% with dulaglutide, 0% with placebo). Changes in waist circumference ranged from -2·1 cm to -10·2 cm for LY3298176 (vs -1·3 cm for placebo, -2·5 cm for dulaglutide). Changes in total cholesterol ranged from 0·2 mmol/L to -0·3 mmol/L for LY3298176 (vs 0·3 mmol/L for placebo, -0·2 mmol/L for dulaglutide). Changes in HDL or LDL cholesterol did not differ between the LY3298176 and placebo groups. Changes in triglyceride concentration ranged from 0 mmol/L to -0·8 mmol/L for LY3298176 (vs 0·3 mmol/L for placebo, -0·3 mmol/L for dulaglutide). The 12-week outcomes were similar to those at 26 weeks for all secondary outcomes. 13 (4%) of 316 participants across the six treatment groups had 23 serious adverse events in total. Gastrointestinal events (nausea, diarrhoea, and vomiting) were the most common treatment-emergent adverse events. The incidence of gastrointestinal events was dose-related (23·1% for 1 mg LY3298176, 32·7% for 5 mg LY3298176, 51·0% for 10 mg LY3298176, and 66·0% for 15 mg LY3298176, 42·6% for dulaglutide, 9·8% for placebo); most events were mild to moderate in intensity and transient. Decreased appetite was the second most common adverse event (3·8% for 1 mg LY3298176, 20·0% for 5 mg LY3298176, 25·5% for 10 mg LY3298176, 18·9% for 15 mg LY3298176, 5·6% for dulaglutide, 2·0% for placebo). There were no reports of severe hypoglycaemia. One patient in the placebo group died from lung adenocarcinoma stage IV, which was unrelated to study treatment. INTERPRETATION: The dual GIP and GLP-1 receptor agonist, LY3298176, showed significantly better efficacy with regard to glucose control and weight loss than did dulaglutide, with an acceptable safety and tolerability profile. Combined GIP and GLP-1 receptor stimulation might offer a new therapeutic option in the treatment of type 2 diabetes. FUNDING: Eli Lilly and Company.