To determine whether bariatric surgery is associated with a lower risk of cancer. Obesity is strongly associated with many types of cancer. Few studies have examined the relationship between bariatric surgery and cancer risk. We conducted a retrospective cohort study of patients undergoing bariatric surgery between 2005 and 2012 with follow-up through 2014 using data from a large integrated health insurance and care delivery systems with 5 study sites. The study included 22,198 subjects who had bariatric surgery and 66,427 nonsurgical subjects matched on sex, age, study site, body mass index, and Elixhauser comorbidity index. Multivariable Cox proportional-hazards models were used to examine incident cancer up to 10 years after bariatric surgery compared to the matched nonsurgical patients. After a mean follow-up of 3.5 years, we identified 2543 incident cancers. Patients undergoing bariatric surgery had a 33% lower hazard of developing any cancer during follow-up [hazard ratio (HR) 0.67, 95% confidence interval (CI) 0.60, 0.74, P < 0.001) compared with matched patients with severe obesity who did not undergo bariatric surgery, and results were even stronger when the outcome was restricted to obesity-associated cancers (HR 0.59, 95% CI 0.51, 0.69, P < 0.001). Among the obesity-associated cancers, the risk of postmenopausal breast cancer (HR 0.58, 95% CI 0.44, 0.77, P < 0.001), colon cancer (HR 0.59, 95% CI 0.36, 0.97, P = 0.04), endometrial cancer (HR 0.50, 95% CI 0.37, 0.67, P < 0.001), and pancreatic cancer (HR 0.46, 95% CI 0.22, 0.97, P = 0.04) was each statistically significantly lower among those who had undergone bariatric surgery compared with matched nonsurgical patients. In this large, multisite cohort of patients with severe obesity, bariatric surgery was associated with a lower risk of incident cancer, particularly obesity-associated cancers, such as postmenopausal breast cancer, endometrial cancer, and colon cancer. More research is needed to clarify the specific mechanisms through which bariatric surgery lowers cancer risk.