The use of antidepressants in major depressive disorder (MDD) has been reported to influence long-term risk of Alzheimer's disease (AD) and AD-related dementias (AD/ADRD), but studies are conflicting. We used inverse probability weighted (IPW) Cox models with time-varying covariates in a retrospective cohort study among midlife veterans with MDD within the US Veterans Affairs healthcare system from January 1, 2000 to June 1, 2022. A total of 35,200 patients with MDD were identified. No associations were seen regarding the effect of being exposed to any antidepressant versus no exposure on AD/ADRD risk (events=1,056, hazard ratio=0.94, 95% confidence interval: 0.81 to 1.09) or the exposure to specific antidepressant classes versus no exposure. A risk reduction was observed for female patients in a stratified analysis; however, the number of cases was small. Our study suggests that antidepressant exposure has no effect on AD/ADRD risk. The association in female patients should be interpreted with caution and requires further attention. We studied whether antidepressant use was associated with future dementia risk. We specifically focused on patients after their first-ever diagnosis of depression. We used IPW Cox models with time-varying covariates and a large observation window. Our study did not identify an effect of antidepressant use on dementia risk. A risk reduction was observed in female patients, but the number of cases was small.