We aimed to determine the association of depression with dementia risk in people with type 2 diabetes, and to explore the possible mediating role of inflammation in this relationship.The Edinburgh Type 2 Diabetes Study is a prospective cohort of 1066 men and women with type 2 diabetes aged 60-75 years. Cox proportional hazards regression analysis was used to investigate the association between depression, assessed at baseline, and subsequent risk of dementia over 10 years. Depression was defined using the Hospital Anxiety and Depression Scale, while incident dementia was defined using medical records, prescription data and death certificates. The potential mediating effect of systemic inflammation was assessed by adjusting models for a generalised inflammation factor, derived from four inflammatory markers measured at baseline (C-reactive protein, IL-6, TNF-α and fibrinogen), and carrying out an exploratory mediation analysis.Dementia developed in 105 participants over a median follow-up of 10.6 years. After adjusting for age and sex, depression was associated with over a 2.5-fold increase in risk of dementia (HR 2.59 [95% CI 1.62, 4.15]). Additional adjustment for the generalised inflammation factor and other covariates did not attenuate the size of association between depression and incident dementia and mediation analysis showed that it was not a mediator. Adjusted logistic regression models showed cross-sectional associations of C-reactive protein and IL-6 with depression.Depression is an important risk factor for dementia in people with type 2 diabetes. Some inflammatory markers were associated with depression, but systemic inflammation does not appear to mediate the relationship between depression and dementia. Graphical abstract.