; for the PCORnet Bariatric Study Collaborative IMPORTANCE Bariatric surgery can lead to substantial improvements in type 2 diabetes (T2DM), but outcomes vary across procedures and populations. It is unclear which bariatric procedure has the most benefits for patients with T2DM. OBJECTIVE To evaluate associations of bariatric surgery with T2DM outcomes. DESIGN, SETTING, AND PARTICIPANTS This cohort study was conducted in 34 US health system sites in the National Patient-Centered Clinical Research Network Bariatric Study. Adult patients with T2DM who had bariatric surgery between January 1, 2005, and September 30, 2015, were included. Data analysis was conducted from April 2017 to August 2019. INTERVENTIONS Roux-en-Y gastric bypass (RYGB) or sleeve gastrectomy (SG). MAIN OUTCOME AND MEASURES Type 2 diabetes remission, T2DM relapse, percentage of total weight lost, and change in glycosylated hemoglobin (hemoglobin A 1c). RESULTS A total of 9710 patients were included (median [interquartile range] follow-up time, 2.7 [2.9] years; 7051 female patients [72.6%]; mean [SD] age, 49.8 [10.5] years; mean [SD] BMI, 49.0 [8.4]; 6040 white patients [72.2%]). Weight loss was significantly greater with RYGB than SG at 1 year (mean difference, 6.3 [95% CI, 5.8-6.7] percentage points) and 5 years (mean difference, 8.1 [95% CI, 6.6-9.6] percentage points). The T2DM remission rate was approximately 10% higher in patients who had RYGB (hazard ratio, 1.10 [95% CI, 1.04-1.16]) than those who had SG. Estimated adjusted cumulative T2DM remission rates for patients who had RYGB and SG were 59.2% (95% CI, 57.7%-60.7%) and 55.9% (95% CI, 53.9%-57.9%), respectively, at 1 year and 86.1% (95% CI, 84.7%-87.3%) and 83.5% (95% CI, 81.6%-85.1%) at 5 years postsurgery. Among 6141 patients who experienced T2DM remission, the subsequent T2DM relapse rate was lower for those who had RYGB than those who had SG (hazard ratio, 0.75 [95% CI, 0.67-0.84]). Estimated relapse rates for those who had RYGB and SG were 8.4% (95% CI, 7.4%-9.3%) and 11.0% (95% CI, 9.6%-12.4%) at 1 year and 33.1% (95% CI, 29.6%-36.5%) and 41.6% (95% CI, 36.8%-46.1%) at 5 years after surgery. At 5 years, compared with baseline, hemoglobin A 1c was reduced 0.45 (95% CI, 0.27-0.63) percentage points more for patients who had RYGB vs patients who had SG. CONCLUSIONS AND RELEVANCE In this large multicenter study, patients who had RYGB had greater weight loss, a slightly higher T2DM remission rate, less T2DM relapse, and better long-term glycemic control compared with those who had SG. These findings can help inform patient-centered surgical decision-making.