Aims: To examine the comparative effectiveness of glucagon-like peptide-1 receptor agonists (GLP-1RAs) and sodium-glucose cotransporter-2 (SGLT2) inhibitors for select cardiovascular outcomes and to examine whether the relative risks varied across different patient subgroups in patients with type 2 diabetes. Materials and Methods: We conducted a nationwide cohort study of patients with type 2 diabetes who initiated GLP-1RAs or SGLT2 inhibitors between 2012 and 2018 in Taiwan. The study outcomes included myocardial infarction and total stroke, further classified into ischaemic or haemorrhagic stroke. We estimated the hazard ratios (HRs) and 95% confidence intervals (CIs) for each outcome, comparing GLP-1RAs with SGLT2 inhibitors using Cox proportional hazards models after 1:1 propensity-score (PS) matching. We also examined if there was effect modification by age, underlying chronic kidney disease, or coexisting cardiovascular disease in prespecified subgroup analyses. Results: Among 26 032 PS-matched patients, GLP-1RA initiators and SGLT2 inhibitor initiators showed similar risks of myocardial infarction (HR 0.99, 95% CI 0.65-1.52), total stroke (HR 0.90, 95% CI 0.69-1.17), ischaemic stroke (HR 0.86, 95% CI 0.65-1.14) and haemorrhagic stroke (HR 0.88, 95% CI 0.63-1.25). However, GLP-1RA treatment was associated with an increased risk of total stroke (HR 1.76, 95% CI 1.06-2.94) and ischaemic stroke (HR 1.88, 95% CI 1.09-3.23) among patients with chronic kidney disease, but not among patients without chronic kidney disease. GLP-1RA therapy seemed to have a lower risk of haemorrhagic stroke among patients with cardiovascular disease (HR 0.64, 95% CI 0.43-0.97), but not in patients without cardiovascular disease. Conclusions: Glucagon-like peptide-1 receptor agonists and SGLT2 inhibitors appeared to have comparable effectiveness with regard to several cardiovascular outcomes overall, but their comparative effectiveness may vary in certain patient subgroups.