Studies on humans show that depressive disorder is associated with an increased risk of developing cognitive dysfunction, and animal studies suggest that antidepressants may have neuroprotective abilities. On the basis of these observations, it was hypothesized that treatment with antidepressants may decrease the risk of developing dementia in patients with depression. We investigated whether continued treatment with antidepressants is associated with a decreased rate of dementia in a population of patients discharged from psychiatric healthcare service with a diagnosis of depression. We used register data on all prescribed antidepressants in all patients discharged from psychiatric healthcare service with a diagnosis of depression and with subsequent diagnoses of dementia in Denmark from 1995 to 2005. A total of 37 658 patients with a diagnosis of depression at their first psychiatric contact and who were exposed to antidepressants after discharge were included in the study. A total of 2007 patients (5.3%) were subsequently diagnosed with dementia of any kind. The rate of dementia decreased during periods of two or more prescriptions of older antidepressants compared with the period of only one prescription of older antidepressants [relative risk (RR)=0.83 (95% confidence interval (CI)=0.70–0.98)]. This finding was replicated with Alzheimer’s disease as the outcome [RR=0.66 (95% CI=0.47–0.94)] but not with dementia of other kinds as the outcome [RR=0.88 (95% CI=0.73–1.06)]. In contrast, during periods of continued use of selective serotonin reuptake inhibitors or newer nonselective serotonin reuptake inhibitors, the rate of dementia was not decreased, regardless of the subtype of dementia. It was concluded that continued long-term treatment with older antidepressants is associated with a reduced rate of dementia in patients treated in psychiatric healthcare settings, whereas continued treatment with other kinds of antidepressants is not. Methodological reasons for these findings cannot be excluded because of the nonrandomized nature of data.