CONTEXT: Depression and dementia are common in older adults and often co-occur, but it is unclear whether depression is an etiologic risk factor for dementia. OBJECTIVE: To clarify the timing and nature of the association between depression and dementia. DESIGN: We examined depressive symptoms assessed in midlife (1964-1973) and late life (1994-2000) and the risks of dementia, Alzheimer disease (AD), and vascular dementia (VaD) (2003-2009) in a retrospective cohort study. Depressive symptoms were categorized as none, midlife only, late life only, or both. Cox proportional hazards models (age as timescale) adjusted for demographics and medical comorbidities were used to examine depressive symptom category and risk of dementia, AD, or VaD. SETTING: Kaiser Permanente Medical Care Program of Northern California. PARTICIPANTS: Thirteen thousand five hundred thirty-five long-term Kaiser Permanente members. Main Outcome Measure Any medical record diagnosis of dementia or neurology clinic diagnosis of AD or VaD. RESULTS: Subjects had a mean (SD) age of 81.1 (4.5) years in 2003, 57.9% were women, and 24.2% were nonwhite. Depressive symptoms were present in 14.1% of subjects in midlife only, 9.2% in late life only, and 4.2% in both. During 6 years of follow-up, 22.5% were diagnosed with dementia (5.5% with AD and 2.3% with VaD). The adjusted hazard of dementia was increased by approximately 20% for midlife depressive symptoms only (hazard ratio, 1.19 [95% CI, 1.07-1.32]), 70% for late-life symptoms only (1.72 [1.54-1.92]), and 80% for both (1.77 [1.52-2.06]). When we examined AD and VaD separately, subjects with late-life depressive symptoms only had a 2-fold increase in AD risk (hazard ratio, 2.06 [95% CI, 1.67-2.55]), whereas subjects with midlife and late-life symptoms had more than a 3-fold increase in VaD risk (3.51 [2.44-5.05]). CONCLUSIONS: Depressive symptoms in midlife or in late life are associated with an increased risk of developing dementia. Depression that begins in late life may be part of the AD prodrome, while recurrent depression may be etiologically associated with increased risk of VaD.