ImportanceWeight loss induced by bariatric surgery (BS) is associated with improved cognition and changed brain structure; however, previous studies on the association have used small cohorts and short follow-up periods, making it difficult to determine long-term neurological outcomes associated with BS.ObjectiveTo investigate long-term associations of weight loss after BS with cognition and brain structure and perfusion.Design, Setting, and ParticipantsThis cohort study included participants from the Bariatric Surgery Rijnstate and Radboudumc Neuroimaging and Cognition in Obesity study. Data from participants with severe obesity (body mass index [BMI; calculated as weight in kilograms divided by height in meters squared] >40, or BMI >35 with comorbidities) eligible for Roux-en-Y gastric bypass and aged 35 to 55 years were enrolled from a hospital specialized in BS (Rijnstate Hospital, Arnhem, the Netherlands). Participants were recruited between September 2018 and December 2020 with follow-up till March 2023. Data were collected before BS and at 6 and 24 months after BS. Data were analyzed from March to November 2023.ExposureRoux-en-Y gastric bypass.Main Outcomes and MeasuresPrimary outcomes included body weight, BMI, waist circumference, blood pressure, medication use, cognitive performance (20% change index of compound z-score), brain volumes, cortical thickness, cerebral blood flow (CBF), and spatial coefficient of variation (sCOV). Secondary outcomes include cytokines, adipokines, depressive symptoms (assessed using the Beck Depression Inventory), and physical activity (assessed using the Baecke Questionnaire).ResultsA total of 133 participants (mean [SD] age, 46.8 [5.7] years; 112 [84.2%] female) were included. Global cognition was at least 20% higher in 52 participants (42.9%) at 24 months after BS. Compared with baseline, at 24 months, inflammatory markers were lower (mean [SD] high-sensitivity C-reactive protein: 4.77 [5.80] μg/mL vs 0.80 [1.09] μg/mL; P < .001), fewer patients used antihypertensives (48 patients [36.1%] vs 22 patients [16.7%]), and patients had lower depressive symptoms (median [IQR] BDI score: 9.0 [5.0-13.0] vs 3.0 [1.0-6.0]; P < .001) and greater physical activity (mean [SD] Baecke score: 7.64 [1.29] vs 8.19 [1.35]; P < .001). After BS, brain structure and perfusion were lower in most brain regions, while hippocampal and white matter volume remained stable. CBF and sCOV did not change in nucleus accumbens and parietal cortex. The temporal cortex showed a greater thickness (mean [SD] thickness: 2.724 [0.101] mm vs 2.761 [0.007] mm; P = .007) and lower sCOV (median [IQR] sCOV: 4.41% [3.83%-5.18%] vs 3.97% [3.71%-4.59%]; P = .02) after BS.Conclusions and RelevanceThese findings suggest that BS was associated with health benefits 2 years after surgery. BS was associated with improved cognition and general health and changed blood vessel efficiency and cortical thickness of the temporal cortex. These results may improve treatment options for patients with obesity and dementia.