Introduction: Erectile dysfunction (ED) and associated risk factors represent a health problem that significantly affects the quality of life (QoL) of men worldwide, with individual, family, psychological and sexual involvement. Objective: To determine the prevalence of erectile dysfunction and associated risk factors in patients aged 30 to 65 years. Methods: Cross-sectional, descriptive study. To outpatients of HGZ/MF No.2, from December 2022 to May 2023, aged 30 to 65 years, who agree to participate in the study. Those under antidepressant treatment were excluded. Sociodemographic and clinical variables were analyzed. The IIEF-5 questionnaire was used to evaluate erectile dysfunction and the Montgomery-Asberg Scale for depression. Descriptive statistics and Chi2 were used to determine association between categorical variables with significant p-value <0.05 and SPSS v.23 for data analysis. Results: 206 participants were surveyed with mean age 46.42 ± 10.18 years, 62.62%(n=129) with arterial hypertension, 36.89%(n=76) with diabetes mellitus, 44.7%(n=92) with dyslipidemia and 38.40%(n=79) depression. 47.5%(n=98) presented some degree of erectile dysfunction, light 42.22%(n=87), mean 5.3%(n=11). We found association between ED with age [p<0.001], blood pressure stage [p<0.001], DM2 [p<0.001], smoking [p=0.001], BMI [p=0.002], physical activity [p<0.001] and depression [p<0.001]. Conclusions: Erectile dysfunction was present in half of the surveyed users, finding association with comorbidities; being important as first level physicians, the adequate metabolic control in them, promoting physical activity and a mental health for its prevention.