To investigate the longitudinal impact of type 2 diabetes mellitus (T2DM) on the prodromal and dementia stages of Alzheimer's disease (AD), focusing on diabetes duration and other comorbidities. 1395 dementia-free individuals aged 55-90 years with a maximum 15-year follow-up data were enrolled from the Alzheimer's Disease Neuroimaging Initiative (ADNI) database. Cox proportional hazards regression models were used to estimate hazard ratios (HRs) of the incidence of prodromal or dementia stages of AD. Longer T2DM duration (≥5 years) (multi-adjusted HR=2.19, 95% CI=1.05-4.58), but not shorter T2DM duration (<5 years), was associated with a significantly increased risk of incident prodromal AD over a mean follow-up of 4.8 years. APOE ε4 alleles (HR=3.32, 95% CI=1.41-7.79) and comorbid coronary artery disease (CAD) (HR=3.20, 95% CI=1.29-7.95) further increased the risk of incident prodromal AD in patients with T2DM. No significant association was observed between T2DM and conversational risk of progression from prodromal AD to AD dementia. T2DM, which is characterized by a longer duration, increases the incidence risk of prodromal AD but not AD dementia. APOE ε4 allele and comorbid CAD strengthen the relationship between T2DM and prodromal AD. These findings highlight T2DM characteristics and its comorbidities as predictors for accurate prediction of AD and screening of at-risk populations.