Importance: To our knowledge, an observational study on the remission of type 2 diabetes mellitus (T2DM) after different types of bariatric surgery based on data from general practice has not been carried out., Objective: To assess the effect of different types of bariatric surgery in patients with T2DM on diabetes remission compared with matched control patients, and the effect of the type of bariatric surgery on improvement of glycemic control and related clinical parameters., Design, Setting, and Participants: A retrospective cohort study conducted from May 2013 to May 2014 within the Clinical Practice Research Datalink involving 2978 patients with a record of bariatric surgery (2005-2012) and a body mass index (calculated as weight in kilograms divided by height in meters squared) of 35 or greater. We identified 569 patients with T2DM and matched them to 1881 patients with diabetes without bariatric surgery. Data on the use of medication and laboratory results were evaluated., Exposures: Bariatric surgery, stratified by type of surgery (gastric banding, Roux-en-Y gastric bypass, sleeve gastrectomy, or other/unknown)., Main Outcomes and Measures: Remission of T2DM (complete discontinuation of glycemic therapy, accompanied with a subsequently recorded hemoglobin A1c level<6.0%)., Results: Among patients undergoing bariatric surgery, we found a prevalence of 19.1% for T2DM. Per 1000 person-years, 94.5 diabetes mellitus remissions were found in patients who underwent bariatric surgery compared with 4.9 diabetes mellitus remissions in matched control patients. Patients with diabetes who underwent bariatric surgery had an 18-fold increased chance for T2DM remission (adjusted relative rate [RR], 17.8; 95% CI, 11.2-28.4) compared with matched control patients. The greatest effect size was observed for gastric bypass (adjusted RR, 43.1; 95% CI, 19.7-94.5), followed by sleeve gastrectomy (adjusted RR, 16.6; 95% CI, 4.7-58.4) and gastric banding (adjusted RR, 6.9; 95% CI, 3.1-15.2). Body mass index and triglyceride, blood glucose, and hemoglobin A1c levels sharply decreased during the first 2 years after bariatric surgery., Conclusions and Relevance: Population-based data show that bariatric surgery strongly increases the chance for remission of T2DM. Gastric bypass and sleeve gastrectomy have a greater effect than gastric banding. Although the risks and possible adverse effects of surgery should be weighed against its benefits, bariatric surgery and, in particular, gastric bypass or sleeve gastrectomy may be considered as new treatment options for T2DM.