Objective(s) To examine the association between obstructive sleep apnea (OSA) and other sleep indices using polysomnography (PSG) data and erectile dysfunction (ED) in a representative cohort of men. Design Cross-sectional. Setting Community-based. Participants Aged 40+ years (n = 734; mean age [SD], 60.8 [10.9]). Measurements Men with no prior OSA diagnosis who underwent in-home PSG (Embletta X100; 2010-11) and ED assessment (Global Impotence Rating) were selected. Un-adjusted and multi-adjusted regression models of ED were fitted against PSG measures, along with qualifying sociodemographic, lifestyle, and health-related covariates. Mediation effects were examined using the Baron-Kenny method. Results Of the men examined, 24.7% (n = 181) had ED, most notably in men older than 65 years (cf. men 35-49 and 50-64years; P < .001). There was no significant association between ED and any of the PSG measures for allaged men. Given an observed ageinteraction within OSA categories (P = .005), analyses were repeated in age-stratified samples (<65 years; 65+ years). In men younger than 65 years, only severe OSA was found to have an association with ED (2.01; 1.13-4.69) in unadjusted models. For men aged 65+ years, an independent association with ED was found for apnea-hyponea index (AHI; 1.55;1.02-2.36), moderate (AHI:10.0-19.9; 1.79;1.18-2.43), and severe (AHI:20.0+; 4.84;2.56-9.93) OSA, and oxygen desaturation index (ODI; both continuous [1.48;1.03-1.99] and >16 seconds [2.79;1.23-6.32]). The effect of AHI on ED was shown to be primarily mediated through ODI (63.4%, Sobel P value = .29). Conclusions In younger, community-based men, there appeared no independent relationship between objective measures of sleep and ED. However, there appears a strong, independent relationship between OSA, ODI, and ED in men 65 years and older.