IMPORTANCE Retinal structures may serve as a biomarker for dementia, but longitudinal studies examining this link are lacking. OBJECTIVE To investigate the association of inner retinal layer thickness with prevalent and incident dementia in a general population of Dutch adults. DESIGN, SETTING, AND PARTICIPANTS From September 2007 to June 2012, participants from the prospective population-based Rotterdam Study who were 45 years and older and had gradable retinal optical coherence tomography images and at baseline were free from stroke, Parkinson disease, multiple sclerosis, glaucoma, macular degeneration, retinopathy, myopia, hyperopia, and optic disc pathology were included. They were followed up until January 1, 2015, for the onset of dementia. EXPOSURES Inner retinal layer thicknesses (ie, retinal nerve fiber layer [RNFL]) and ganglion cell-inner plexiform layer (GC-IPL) thicknesses measured on optical coherence tomography images. MAIN OUTCOMES AND MEASURES Odds ratios and hazard ratios for incident dementia per SD decrease in retinal layer thickness adjusted for age, sex, education, and cardiovascular risk factors. RESULTS Of 5065 individuals eligible for optical coherence tomography scanning, 3289 (64.9%) (mean [SD] age 68.9 [9.9] years, 1879 [57%] women) were included in the analysis. Of these 3289 individuals, 41 (1.2%) already had dementia. Thinner GC-IPL was associated with prevalent dementia (odds ratio per SD decrease in GC-IPL, 1.37 [95% CI, 0.99-1.90]). No association was found of RNFL with prevalent dementia. During 14 674 person-years of follow-up (mean [SD], 4.5 [1.6] years), 86 individuals (2.6%) developed dementia of whom 68 (2.1%) had Alzheimer disease. Thinner RNFL at baseline was associated with an increased risk of developing dementia (hazard ratio per SD decrease in RNFL, 1.44 [95% CI, 1.19-1.75]), which was similar for Alzheimer disease (hazard ratio, 1.43 [95% CI, 1.15-1.78]). No association was found between GC-IPL thickness and incident dementia (hazard ratio, 1.13 [95% CI, 0.90-1.43]). CONCLUSIONS AND RELEVANCE Thinner RNFL is associated with an increased risk of dementia, including Alzheimer disease, suggesting that retinal neurodegeneration may serve as a preclinical biomarker for dementia.