Importance: Obesity is associated with an increased prevalence of psychiatric disorders. The association of bariatric surgery with mental health outcomes is poorly understood. Objective: To investigate the association of bariatric surgery with the incidence of outpatient, emergency department (ED), and inpatient mental health service use. Design, Setting, and Participants: This statewide, mirror-image, longitudinal cohort study used data from Western Australian Department of Health Data Linkage Branch records from all patients undergoing index (ie, first) bariatric surgery in Western Australia over a 10-year period (January 2007-December 2016), with mean (SD) follow-up periods of 10.2 (2.9) years before and 5.2 (2.9) years after index bariatric surgery. The data analysis was performed between November 2018 and March 2019. Exposures: Index bariatric surgery. Main Outcomes and Measures: The incidence and predictors for mental health presentations, deliberate self-harm, and suicide in association with the timing of bariatric surgery. Results: A total of 24766 patients underwent index bariatric surgery; of these, the mean (SD) age was 42.5 (11.7) years and 19144 (77.3%) were women. Use of at least 1 mental health service occurred in 3976 patients (16.1%), with 1401 patients (35.2%) presenting only before surgery, 1025 (25.8%) presenting before and after surgery, and 1550 patients (39.0%) presenting only after surgery. There was an increase in psychiatric illness presentations after bariatric surgery (outpatient clinic attendance: incidence rate ratio [IRR], 2.3; 95% CI, 2.3-2.4; ED attendance: IRR, 3.0; 95% CI, 2.8-3.2; psychiatric hospitalization: IRR, 3.0; 95% CI, 2.8-3.1). There was also a 5-fold increase in deliberate self-harm presentations to an ED after surgery (IRR, 4.7; 95% CI, 3.8-5.7), with 25 of 261 postoperatives deaths (9.6%) due to suicide. Complications after bariatric surgery requiring further surgical intervention and a history of mental health service provision before surgery were the most important associations with subsequent mental health presentations after surgery. Deliberate self-harm and mental and behavioral disorders due to psychoactive substance use before bariatric surgery were the main associations with subsequent deliberate self-harm or suicide after surgery. Conclusions and Relevance: We observed an increase in mental health service presentations after bariatric surgery, particularly among those who had prior psychiatric illnesses or developed surgical complications requiring further surgery. These findings caution the hypothesis that weight reduction by bariatric surgery will improve mental health in patients with obesity.