Low testosterone levels in men are associated with type 2 diabetes mellitus. Erectile dysfunction (ED) is a frequent complication of type 2 diabetes. The aim of our cross-sectional study was to investigate the relationship between ED and total, bioavailable and free testosterone levels in 198 men with type 2 diabetes. In addition, we examined the associations of various cardiovascular risk factors involved in the development of ED in type 2 diabetic men. We found that bioavailable and free testosterone levels were significantly lower in men with ED (p = 0.006 and 0.027 respectively) than those without ED. Sex hormone-binding globulin levels were also reduced, but there was no significant difference in total testosterone (TT) levels between men with and without ED. The severity of ED as assessed by International Index of Erectile Function scores was significantly associated with TT (r = 0.32; p < 0.001), bioavailable testosterone (r = 0.32; p < 0.001) and calculated free testosterone (r = 0.35; p < 0.001) levels. ED was more frequently observed in men with hypertension and a higher waist circumference (p = 0.03). There was also a higher prevalence of ED among smokers (p = 0.06), but there were no significant associations between ED and alcohol consumption or with BMI > 30. This study has shown that ED is associated with low bioavailable and free testosterone levels, age, visceral adiposity and hypertension in type 2 diabetic men.