Diabetes is a major risk factor for erectile dysfunction, however, the effect of GLP-1 receptor agonists on erectile dysfunction is unknown. We aimed to assess the incidence, prevalence, and progression of erectile dysfunction in men treated with dulaglutide compared with placebo, and to determine whether dulaglutide's effect on erectile dysfunction was consistent with its effect on other diabetes-related outcomes. The Researching Cardiovascular Events with a Weekly Incretin in Diabetes (REWIND) trial was a double-blind, placebo-controlled randomised trial of the effect of dulaglutide on cardiovascular outcomes. REWIND was done at 371 sites in 24 countries. Men and women aged older than 50 years with type 2 diabetes, who had either a previous cardiovascular event or cardiovascular risk factors, were randomly assigned (1:1) to receive either dulaglutide or placebo. Participating men were offered the opportunity to complete the standardised International Index of Erectile Function (IIEF) questionnaire at baseline, 2 years, 5 years, and study end. We did an exploratory analysis, in which we included participants who completed a baseline and at least 1 follow-up IIEF questionnaire. The primary outcome for these analyses was the first occurrence of moderate or severe erectile dysfunction following randomisation, assessed by the erectile function subscores on IIEF. This analysis was part of the REWIND trial, which is registered with ClinicalTrials.gov, NCT01394952. Between Aug 18, 2011, and Aug 14, 2013, 3725 (70·1%) of 5312 male participants with a mean age of 65·5 years (SD 6·4 years) were analysed, of whom 1487 (39·9%) had a history of cardiovascular disease, and 2104 (56·5%) had moderate or severe erectile dysfunction at baseline. The incidence of erectile dysfunction following randomisation was 21·3 per 100 person-years in the dulaglutide group and 22·0 per 100 person-years in the placebo group (HR 0·92, 95% CI 0·85-0·99, p=0·021). Men in the dulaglutide group also had a lesser fall in erectile function subscore compared with the placebo group, with a least square mean difference of 0·61 (95% CI 0·18-1·05, p=0·006). Long-term use of dulaglutide might reduce the incidence of moderate or severe erectile dysfunction in men with type 2 diabetes. Eli Lilly and Company.