Objective Experimental evidence has shown potential cardioprotective actions of phosphodiesterase type-5 inhibitors (PDE5is). We investigated whether PDE5i use in patients with type 2 diabetes, with high-attendant cardiovascular risk, was associated with altered mortality in a retrospective cohort study. Research design and methods Between January 2007 and May 2015, 5956 men aged 40-89 years diagnosed with type 2 diabetes before 2007 were identified from anonymised electronic health records of 42 general practices in Cheshire, UK, and were followed for 7.5 years. HRs from multivariable survival (accelerated failure time, Weibull) models were used to describe the association between on-demand PDE5i use and all-cause mortality.Results Compared with non-users, men who are prescribed PDE5is (n=1359) experienced lower percentage of deaths during follow-up (19.1% vs 23.8%) and lower risk of all-cause mortality (unadjusted HR=0.69 (95% CI: 0.64 to 0.79); p<0.001)). The reduction in risk of mortality (HR=0.54 (0.36 to 0.80); p=0.002) remained after adjusting for age, estimated glomerular filtration rate, smoking status, prior cerebrovascular accident (CVA) hypertension, prior myocardial infarction (MI), systolic blood pressure, use of statin, metformin, aspirin and β-blocker medication. PDE5i users had lower rates of incident MI (incidence rate ratio (0.62 (0.49 to 0.80), p<0.0001) with lower mortality (25.7% vs 40.1% deaths; age-adjusted HR=0.60 (0.54 to 0.69); p=0.001) compared with non-users within this subgroup. Conclusion In a population of men with type 2 diabetes, use of PDE5is was associated with lower risk of overall mortality and mortality in those with a history of acute MI.Erectile dysfunction (ED) is increasingly recognised as an early marker of cardiovascular disease (CVD).