The aim of this study is to evaluate the association between physical activity level and physical fitness with erectile dysfunction in men aged 40-75 years. We examined 180 men aged 40-75 years. The individuals were evaluated for age, presence of dyslipidemia and smoking and for anthropometric parameters for the characterization of body mass index. For assessing the level of physical fitness, a test was performed to measure the indirect maximum oxygen consumption. The evaluation of erectile function was made by the International Index of Erectile Function questionnaire and assessment of physical activity level by the International Physical Activity questionnaire in its short version. This study showed that younger men with higher physical activity and better physical fitness are less likely to suffer from erectile dysfunction. Multivariable analysis through logistic regression showed that age (odds ratio (OD)=1.15; 95% confidence interval (95% CI)=1.07-1.23), physical activity (OD=10.38; 95% CI=3.94-27.39) and physical fitness (OD=4.62; 95% CI=1.75-12.25) were independent variables associated with erectile dysfunction. This study reinforces the concept that healthy habits have a direct effect on erectile function.