GLP-1 receptor agonists and SGLT2 inhibitors are increasingly being used in people with type 2diabetes on the basis of findings from randomised clinical trials; however, little is known of whether clinical outcomes are affected by frailty in real-world settings. We aimed to compare the clinical effectiveness and safety of GLP-1 receptor agonists and SGLT2 inhibitors in managing type 2diabetes, with a specific focus on stratifying people by their frailty status. In this retrospective, nationwide, longitudinal study, we identified people (aged ≥20years) with type 2 diabeteswho newly initiated either a GLP-1 receptor agonist or an SGLT2 inhibitor during the period Jan 1, 2017to Dec 31, 2019 from the Taiwan National Health Insurance database. Individuals were excluded if they had been diagnosed with cancer, received dialysis for kidney failure, or had prescriptions for a GLP-1 receptor agonist or an SGLT2 inhibitor, within 1year before the index date. Mortality data were collected from the Taiwan National DeathRegistry. Eligible individuals were categorised into three frailty subgroups-fit, mild frailty, and moderate or severe frailty-on the basis of the multimorbidity frailty index. Propensity score matching (1:1) was used to balance covariates between recipients of GLP-1 receptor agonists and SGLT2 inhibitors among each frailty subgroup. Clinical outcomes of interest included three-point major adverse cardiovascular events (non-fatal acute myocardial infarction, non-fatal stroke, and fatal cardiovascular disease), all-cause mortality, hospitalisation for heart failure, dialysis or renal transplant, severe diabetic foot complications, retinopathy, hospitalisation for severe hyperglycaemia, and hospitalisation for severe hypoglycaemia. The association between the use of a GLP-1 receptor agonist versus an SGLT2 inhibitor and the risk of the outcomes of interest among each frailty subgroup was examined using a subdistribution hazard model. We identified 320 210people with type 2diabetes, of whom 280 163 met the eligibility criteria, who initiated either a GLP-1 receptor agonist (n=22 968; mean age 57·7years [SD 13·9], 11 338 [49·4%] were female, and 11 630 [50·6%] were male) or SGLT2 inhibitor (n=257 195; mean age 58·8years [12·3], 107 988 [42·0%] were female, and 149 207 [58·0%] were male) during 2017-19. After matching, 11 882, 7210, and 3414pairs of GLP-1 receptor agonist and SGLT2 inhibitor users were assigned in the fit, mild frailty, and moderate or severe frailty subgroups. All clinical outcomes were comparable between users of GLP-1 receptor agonists and SGLT2 inhibitors among each frailty subgroup, except fora higher risk of hospitalisation for severe hyperglycaemia with GLP-1 receptor agonists than withSGLT2 inhibitors in the mild frailty subgroup (subdistribution hazard ratio 1·25 [95% CI 1·13-1·38]; p<0·0001) and a higher risk of dialysis or renal transplant with GLP-1 receptor agonists than with SGLT2 inhibitors in the fit (2·43 [1·82-3·23]; p<0·0001), mild frailty (3·93 [3·03-5·09]; p<0·0001), and moderate or severe frailty (2·60 [2·03-3·31]; p<0·0001) subgroups. Formulating clear and updated guidelines on the use of GLP-1 receptor agonists and SGLT2 inhibitors according to frailty status could improve management of type 2diabetes. Ministry of Education, Taiwan.