Background: Bariatric surgery leads to sustained weight loss in a majority of recipients, and also reduces fasting insulin levels and markers of inflammation. We described the long-term associations between bariatric surgery and clinical outcomes including 30 morbidities. Methods: We did a retrospective population-based cohort study of 304,157 adults with severe obesity, living in Alberta, Canada; 6,212 of whom had bariatric surgery. We modelled adjusted time to mortality, hospitalization, surgery and the adjusted incidence/prevalence of 30 morbidities after 5 years of follow-up. Results: Over a median follow-up of 4.4 years (range 1 day-22.0 years), bariatric surgery was associated with increased risk of hospitalization (HR 1.46, 95% CI 1.41,1.51) and additional surgery (HR 1.42, 95% CI 1.32,1.52) but with a decreased risk of mortality (HR 0.76, 95% CI 0.64,0.91). After 5 years, bariatric surgery was associated with a lower risk of severe chronic kidney disease (HR 0.45, 95% CI 0.27,0.75), coronary disease (HR 0.49, 95% CI 0.33,0.72), diabetes (HR 0.51, 95% CI 0.47,0.56), inflammatory bowel disease (HR 0.55, 95% CI 0.37,0.83), hypertension (HR 0.70, 95% CI 0.66,0.75), chronic pulmonary disease (HR 0.75, 95% CI 0.66,0.86), asthma (HR 0.79, 95% 0.65,0.96), cancer (HR 0.79, 95% CI 0.65,0.96), and chronic heart failure (HR 0.79, 95% CI 0.64,0.96). In contrast, after 5 years, bariatric surgery was associated with an increased risk of peptic ulcer (HR 1.99, 95% CI 1.32,3.01), alcohol misuse (HR 1.55, 95% CI 1.25,1.94), frailty (HR 1.28, 95% 1.11,1.46), severe constipation (HR 1.26, 95% CI 1.07,1.49), sleep disturbance (HR 1.21, 95% CI 1.08,1.35), depression (HR 1.18, 95% CI 1.10,1.27), and chronic pain (HR 1.12, 95% CI 1.04,1.20). Interpretation: Bariatric surgery was associated with lower risks of death and certain morbidities. However, bariatric surgery was also associated with increased risk of hospitalization and additional surgery, as well as certain other morbidities. Since values and preferences for these various benefits and harms may differ between individuals, this suggests that comprehensive counselling should be offered to patients considering bariatric surgery.