ObjectiveTo compare the risks of gastric cancer and other gastric diseases in patients with type-2 diabetes mellitus (T2DM) exposed to sodium-glucose cotransporter 2 inhibitors (SGLT2I), dipeptidyl peptidase-4 inhibitors (DPP4I) or glucagon-like peptide-1 receptor agonists (GLP1a).DesignThis was a population-based cohort study of prospectively collected data on patients with T2DM prescribed SGLT2I, DPP4I or GLP1a between January 1st 2015 and December 31st 2020 from Hong Kong. The outcomes were new-onset gastric cancer, peptic ulcer (PU), acute gastritis, non-acute gastritis, and gastroesophageal reflux disease (GERD). Propensity score matching (1:1) using the nearest neighbour search was performed, and multivariable Cox regression was applied. A three-arm comparison between SGLT2I, DPP4I and GLP1a was conducted using propensity scores with inverse probability of treatment weighting.ResultsA total of 62,858 patients (median age: 62.2 years old [SD: 12.8]; 55.93% males; SGLT2I: n = 23,442; DPP4I: n = 39,416) were included. In the matched cohort, the incidence of gastric cancer was lower in SGLT2I (Incidence rate per 1000 person-year, IR: 0.32; 95% confidence interval, CI 0.23–0.43) than in DPP4I (IR per 1000 person-year: 1.22; CI 1.03–1.42) users. Multivariable Cox regression found that SGLT2I use was associated with lower risks of gastric cancer (HR 0.30; 95% CI 0.19–0.48), PU, acute gastritis, non-acute gastritis, and GERD (p < 0.05) compared to DPP4I use. In the three-arm analysis, GLP1a use was associated with higher risks of gastric cancer and GERD compared to SGLT2I use.ConclusionsThe use of SGLT2I was associated with lower risks of new-onset gastric cancer, PU, acute gastritis, non-acute gastritis, and GERD after matching and adjustments compared to DPP4I use. SGLT2I use was associated with lower risks of GERD and gastric cancer compared to GLP1a use.Graphical abstract