BackgroundTo investigate the association between treatment of anti-diabetic agents and dementia in type 2 diabetes mellitus using an extensive dataset from the Korean National Health Insurance System and Health Screenings. MethodsAfter excluding anyone younger than 40, those taking no anti-diabetic medications within 1 yr of the examination, anyone diagnosed with dementia before the examination or its development within 1 yr of the examination, and those with missing data, 1,578,322 individuals with diabetes prescribed an anti-diabetic agent (metformin (Met), sulfonylurea (SU), thiazolidinedione (TZD), dipeptidyl peptidase-4 inhibitor (DPP-4i), meglitinide (Megl), alpha-glucosidase inhibitor(AGI) and/or insulin) between 2009 and 2012 were identified from the Korean National Health Insurance Service Database, where 701,193 individuals taking oral dual therapy were tracked until 2017. All-cause, Alzheimer’s (AD) and vascular dementia (VaD) were investigated by oral dual therapy. Adjustments were made for age, sex, income, diabetes duration, hypertension, dyslipidaemia, smoking, drinking, exercise, BMI, glucose level and estimated glomerular filtration rate. Results Compared with dual therapy with Met + SU, dual therapy with Met + DPP-4i, Met + TZD, and SU + TZD, was associated with lower all-cause dementia (HR (95% CI) = 0.904 (0.879-0.929), 0.804 (0.767-0.844), and 0.962 (0.929-0.996), respectively) and VaD (HR (95% CI) = 0.865 (0.806-0.928), 0.725 (0.64-0.822), and 0.911 (0.833-0.995), respectively) after adjustment. Also, compared with the group treated with Met + SU, those treated with Met + DPP-4i and Met + TZD were associated with a significantly lower risk of AD (HR (95% CI) = 0.922 (0.894-0.951) and 0.812 (0.77-0.857)) except for SU + TZD (HR (95% CI) = 0.971 (0.934-1.01)). Dual therapy with TZD was associated with a significantly lower risk of all-cause dementia, AD, and VaD than nonusers of TZD (HR (95% CI) = 0.918 (0.892-0.944), 0.925 (0.896-0.955) and 0.859 (0.798-0.924), respectively). Conclusions Adding TZD or DPP-4i instead of SU as second-line treatment in combination with first-line Met may be considered for delaying or preventing dementia. Also, TZD users relative to TZD non-users on dual therapy had a significantly lower risk of all types of dementia.