BackgroundObesity and type 2 diabetes mellitus (T2DM) are risk factors for severe COVID-19 infection. Bariatric surgery (BSG) is an effective treatment of obesity through weight loss and may reduce COVID-19 severity. ObjectivesWe examined the effect of BSG on COVID-19 outcomes in patients with or at risk of T2DM. SettingElectronic health record data from the PaTH Clinical Data Research Network, a partnership of 5 health systems reviewed from March 1, 2020, to December 31, 2020. MethodsAmbulatory and in-hospital patient encounters with COVID-19 diagnosis and obesity were identified. We constructed 2 patient groups: BSG and non-BSG (NBSG). The BSG group included patients with at least 1 encounter for the BSG procedure code and/or 1 BSG diagnosis code; the NBSG group included patients with no procedure or diagnosis code for BSG with body mass index (BMI) ≥40 or BMI ≥35 and at least 2 obesity-related co-morbidities. We matched 1 patient in the BSG group to 2 patients in the NBSG group based on age, gender (sex defined at birth), race and ethnicity, group (T2DM and at risk of T2DM), and site. The primary outcome was 30-day outcomes of COVID-19 severity. ResultsAfter matching, we found that patients with BSG had lower odds of respiratory failure (41%) and ventilation/intensive care unit (ICU) admission/death (52%). Patients in the BSG group had lower odds of hospitalization, pneumonia, respiratory failure, and the most severe COVID-19 outcomes combined (ventilation/ICU admission/death). T2DM was identified as a risk factor for COVID-19 severity in the BSG group. ConclusionsThis retrospective, matched-cohort analysis found BSG to have a protective effect against severe COVID-19 outcomes.