ImportanceSlow-wave sleep (SWS) supports the aging brain in many ways, including facilitating the glymphatic clearance of proteins that aggregate in Alzheimer disease. However, the role of SWS in the development of dementia remains equivocal.ObjectiveTo determine whether SWS loss with aging is associated with the risk of incident dementia and examine whether Alzheimer disease genetic risk or hippocampal volumes suggestive of early neurodegeneration were associated with SWS loss.Design, Setting, and ParticipantsThis prospective cohort study included participants in the Framingham Heart Study who completed 2 overnight polysomnography (PSG) studies in the time periods 1995 to 1998 and 1998 to 2001. Additional criteria for individuals in this study sample were an age of 60 years or older and no dementia at the time of the second overnight PSG. Data analysis was performed from January 2020 to August 2023.ExposureChanges in SWS percentage measured across repeated overnight sleep studies over a mean of 5.2 years apart (range, 4.8-7.1 years).Main OutcomeRisk of incident all-cause dementia adjudicated over 17 years of follow-up from the second PSG.ResultsFrom the 868 Framingham Heart Study participants who returned for a second PSG, this cohort included 346 participants with a mean age of 69 years (range, 60-87 years); 179 (52%) were female. Aging was associated with SWS loss across repeated overnight sleep studies (mean [SD] change, −0.6 [1.5%] per year; P < .001). Over the next 17 years of follow-up, there were 52 cases of incident dementia. In Cox regression models adjusted for age, sex, cohort, positivity for at least 1 APOE ε4 allele, smoking status, sleeping medication use, antidepressant use, and anxiolytic use, each percentage decrease in SWS per year was associated with a 27% increase in the risk of dementia (hazard ratio, 1.27; 95% CI, 1.06-1.54; P = .01). SWS loss with aging was accelerated in the presence of Alzheimer disease genetic risk (ie, APOE ε4 allele) but not hippocampal volumes measured proximal to the first PSG.Conclusions and RelevanceThis cohort study found that slow-wave sleep percentage declined with aging and Alzheimer disease genetic risk, with greater reductions associated with the risk of incident dementia. These findings suggest that SWS loss may be a modifiable dementia risk factor.