Introduction: The effects of sodium-glucose cotransporter 2 inhibitors (SGLT2I) and dipeptidyl peptidase-4 inhibitors (DPP4I) on new-onset cognitive dysfunction in type 2 diabetes mellitus remain unknown. This study aimed to evaluate the effects of the two novel antidiabetic agents on cognitive dysfunction by comparing the rates of dementia between SGLT2I and DPP4I users.Methods: This was a population-based cohort study of type 2 diabetes mellitus patients treated with SGLT2I and DPP4I between January 1, 2015 and December 31, 2019 in Hong Kong. Exclusion criteria were <1-month exposure or exposure to both medication classes, or prior diagnosis of dementia or major neurological/psychiatric diseases. Primary outcomes were new-onset dementia, Alzheimer's, and Parkinson's. Secondary outcomes were all-cause, cardiovascular, and cerebrovascular mortality.Results: A total of 13,276 SGLT2I and 36,544 DPP4I users (total n = 51,460; median age: 66.3 years old [interquartile range (IQR): 58–76], 55.65% men) were studied (follow-up: 472 [120–792] days). After 1:2 matching (SGLT2I: n = 13,283; DPP4I: n = 26,545), SGLT2I users had lower incidences of dementia (0.19 vs. 0.78%, p < 0.0001), Alzheimer's (0.01 vs. 0.1%, p = 0.0047), Parkinson's disease (0.02 vs. 0.14%, p = 0.0006), all-cause (5.48 vs. 12.69%, p < 0.0001), cerebrovascular (0.88 vs. 3.88%, p < 0.0001), and cardiovascular mortality (0.49 vs. 3.75%, p < 0.0001). Cox regression showed that SGLT2I use was associated with lower risks of dementia (hazard ratio [HR]: 0.41, 95% confidence interval [CI]: [0.27–0.61], P < 0.0001), Parkinson's (HR:0.28, 95% CI: [0.09–0.91], P = 0.0349), all-cause (HR:0.84, 95% CI: [0.77–0.91], P < 0.0001), cardiovascular (HR:0.64, 95% CI: [0.49–0.85], P = 0.0017), and cerebrovascular (HR:0.36, 95% CI: [0.3–0.43], P < 0.0001) mortality.Conclusions: The use of SGLT2I is associated with lower risks of dementia, Parkinson's disease, and cerebrovascular mortality compared with DPP4I use after 1:2 ratio propensity score matching.