OBJECTIVE: To determine whether the use of glucagon-like peptide-1 (GLP-1) receptor agonists is associated with an increased risk of suicidal ideation, self-harm, and suicide among patients with type 2 diabetes compared with the use of dipeptidyl peptidase-4 (DPP-4) inhibitors or sodium-glucose cotransporter-2 (SGLT-2) inhibitors. DESIGN: Active comparator, new user cohort study. SETTING: Primary care practices contributing data to the UK Clinical Practice Research Datalink linked to the Hospital Episodes Statistics Admitted Patient Care and Office for National Statistics Death Registration databases. PARTICIPANTS: Patients with type 2 diabetes. EXPOSURES: Two cohorts were assembled, with the first composed of patients who started and continued on GLP-1 receptor agonists or DPP-4 inhibitors between 1 January 2007 and 31 December 2020 and the second composed of patients who started and continued on GLP-1 receptor agonists or SGLT-2 inhibitors between 1 January 1 2013 and 31 December 2020. Both cohorts were followed until 29 March 2021. MAIN OUTCOME MEASURES: The primary outcome was suicidality, defined as a composite of suicidal ideation, self-harm, and suicide. Secondary outcomes were each of these events considered separately. Propensity score fine stratification weighted Cox proportional hazards models were fitted to estimate hazard ratios and 95% confidence intervals (CIs) to estimate the average treatment effect among the treated patients. RESULTS: The first cohort included 36 082 GLP-1 receptor agonist users (median follow-up 1.3 years) and 234 028 DPP-4 inhibitor users (median follow-up 1.7 years). In crude analyses, GLP-1 receptor agonist use was associated with an increased incidence of suicidality compared with DPP-4 inhibitors (crude incidence rates 3.9 CONCLUSIONS: In this large cohort study, the use of GLP-1 receptor agonists was not associated with an increased risk of suicidality compared with the use of DPP-4 inhibitors or SGLT-2 inhibitors in patients with type 2 diabetes.