Introduction Sexual dysfunction, particularly erectile dysfunction (ED), is common in men with type 2 diabetes, occurring in up to 75% of cases. The prevalence of hypogonadism is also high in men with diabetes and low testosterone is associated with both sexual dysfunction and a reduced response to oral therapy for ED. Aim This study aimed to determine the effect of testosterone replacement with long-acting Testosterone Undecanoate (TU) on sexual function, mood and quality of life vs. placebo over a treatment period of 30 weeks followed by 52 weeks of open-label medication. The study was conducted in a primary care population of men with type 2 diabetes attending their primary care physician for routine visits. Methods The male diabetic populations of seven general practices were screened at routine diabetes visits to detect symptomatic men with total testosterone levels of 12nmol/L or less or with free testosterones of 250pmol/L or less. Two hundred eleven men were screened. A double-blind placebo-controlled study was conducted in 199 men with type 2 diabetes and hypogonadism treated for 30 weeks with either 1,000mg of TU or matching placebo followed by 52-week open-label follow on. Main Outcome Measures The primary outcome measure, International Index of Erectile Function (IIEF), was used to evaluate sexual dysfunction, and the Ageing Male Symptom (AMS), Hospital Anxiety and Depression Scale, and Global Efficacy Question were used as secondary outcome measures to assess mood and self-reported quality of life. Results Testosterone replacement therapy with long-acting TU improved all domains of sexual function at 30 weeks (erectile function [EF], P=0.005; intercourse satisfaction, P=0.015; sexual desire, P=0.001; overall satisfaction, P=0.05; and orgasm, P=0.04), with benefit as early as 6 weeks. Improvements in AMS score were significant in men without depression (P=0.02) and the presence of depression at baseline was associated with marked reduction in response to both sexual function and psychological scores. All responses in sexual function continued to improve significantly up to 18 months with an improvement in EF score of 4.31 from baseline. In a small cohort of 35 men taking phosphodiesterase type 5 inhibitors, there was no change during the double-blind phase but a nine-point improvement in EF domain during 52-week open-label treatment. After 30 weeks, 46% vs. 17% of patients on active therapy vs. placebo felt that the treatment had improved their health, reaching 70% after open-label therapy. Less obese and older patients responded better to testosterone therapy. There were no significant adverse events. Conclusion TU significantly improved all domains of the IIEF and patient reported quality of life at 30 weeks and more significantly after 52-week open-label extension. Improvement was most marked in less obese patient and those without coexisting depression. In men with type 2 diabetes, trials of therapy may need to be given for much longer than 3-6 months suggested in current guidelines.