Erectile dysfunction was one of the most common complications in diabetic patients. According to several studies, its prevalence was two to three times higher in diabetics than in the general population. But it has often been overlooked despite the fact that it seriously affects the quality of life. The aim of this study was to determine the prevalence of erectile dysfunction and its associated factors in diabetics' patients. This was a cross-sectional analysis study of 76 male diabetic patients who consulted by the Department of Endocrinology from June 22, 2019 to September 25, 2019. Erectile dysfunction was diagnosed by calculating the IIEF score. Statistical comparisons were made between patients without and with Erectile dysfunction chi-square test with a significance level p < 0.05. A logistic regression was performed in order to obtain the adjusted odds ratios. Our study included 76 patients with the mean age of 58.55 ± 10.5 years. 72.37% of them were over 50 years old. Erectile dysfunction screening was positive in 69.74%. HbA1c was ≥7% in 50 patients (65.79%). High blood pressure, imbalance in diabetes and its duration are factors that are significantly associated with Erectile dysfunction after logistic regression with p values equal to 0.011, respectively; 0.008 and <0.001. Conclusion: This study showed a high prevalence of erectile dysfunction in diabetics. Significant concomitant factors were hypertension, diabetes imbalance and the duration of diabetes. It was, therefore, important to include systematic screening for erectile dysfunction at least annually, as well as other complications of diabetes.