In this emulated trial involving 88,381 older patients with T2DM, we found real-word evidence suggesting that the use of GLP-1 agonists was associated with a reduced risk of developing dementia compared with DPP-4 inhibitors and sulfonylureas. This evidence concerns the gene DPP4 and dementia.