To compare weight and glucometabolic outcomes of semaglutide and metabolic and bariatric surgery (MBS) for patients with type 2 diabetes and obesity. Patients treated with either semaglutide for a duration of ≥2 years or MBS in Sweden were identified within the Scandinavian Obesity Surgery Registry and the National Diabetes Registry and matched in a 1:1-2 ratio using a propensity score matching with a generalized linear model, including age, sex, glycated haemoglobin before treatment, duration of type 2 diabetes, use of insulin, presence of comorbidities and history of cancer, with good matching results but with a remaining imbalance for glomerular filtration rate and body mass index, which were then adjusted for in the following analyses. Main outcomes were weight loss and glycaemic control. The study included 606 patients in the surgical group matched to 997 controls who started their treatment from 2018 until 2020. Both groups improved in weight and glucometabolic control. At 2 years after the intervention, mean glycated haemoglobin was 42.3 ± 11.18 after MBS compared with 50.7 ± 12.48 after semaglutide treatment (p < 0.001) with 382 patients (63.0%) and 139 (13.9%), respectively, reaching complete remission without other treatment than the intervention (p < 0.001). Mean total weight loss reached 26.4% ± 8.83% after MBS compared with 5.2% ± 7.87% after semaglutide (p < 0.001). Semaglutide and MBS were both associated with improvements in weight and improved glycaemic control at 2 years after the start of the intervention, but MBS was associated with better weight loss and glucometabolic control.