Maternal obesity is associated with increased risk of pregnancy complications such as gestational diabetes, stillbirth, preterm birth, and congenital malformations. While small studies have looked into the effect of prepregnancy bariatric surgery on gestational diabetes, these studies have been inconclusive and have not considered presurgery body mass index (BMI) as a confounder. Some systematic reviews have found a lower risk of neonatal complications after bariatric surgery but included heterogeneous studies with small sample sizes. Taking presurgery BMI into account, this study aims to investigate the risks of adverse perinatal outcomes including gestational diabetes in women who have had bariatric surgery versus women who have not. This population-based study used data from Swedish registries nationwide, which include prenatal, obstetric, and neonatal records. Of 627,693 singleton pregnancies between 2006 and 2011, 670 were in women who had undergone bariatric surgery with presurgery weight documented. Up to 5 control pregnancies in obese women were matched for BMI, age, level of education, years, and smoking history for each pregnancy in the intervention cohort. For controls, weight during early pregnancy was used to calculate BMI. For the study group, BMI was calculated with weight and height measurements at the time of surgery. Outcomes included gestational diabetes, low birth weight, macrosomia, stillbirth, large- and small-for-gestational-age, preterm birth, neonatal death, and major congenital malformations detected during the first year of life. Gestational diabetes was diagnosed by a 2-hour plasma glucose level of 10.0 mmol/L or higher during a glucose tolerance test (with a 75-g loading dose) or a fasting plasma glucose level of 7.0 mmol/L or higher. In the study, 1.9% of the postsurgery pregnancies versus 6.8% of the control pregnancies had gestational diabetes (odds ratio, 0.25; 95% confidence interval [CI], 0.13–0.47; P < 0.001; Table 2). The median gestation time of the diagnosis was 32 weeks for both groups, considering women for whom the diagnosis date was available. The surgery cohort, compared with controls, was associated with an increased risk of small-for-gestational-age infants (15.6% vs 7.6%; odds ratio, 2.20; 95% CI, 1.64–2.95; P < 0.001) and increased risk for low birth weight, although that was not statistically significant (6.8% vs 4.5%; odds ratio, 1.34; 95% CI, 0.88–2.04; P = 0.17). Alternatively, the surgery group had a lower risk for large-for-gestational-age infants compared with the control group (8.6% vs 22.4%; odds ratio, 0.33; 95% CI, 0.24–0.44; P < 0.001) and lower risk of macrosomia (1.2% vs 9.5%; odds ratio, 0.11; 95% CI, 0.05–0.24; P < 0.001). There was no significant difference between the 2 groups in terms of risk of preterm birth (10.0% vs 7.5%; odds ratio, 1.28; 95% CI, 0.92–1.78; P = 0.15), nor in terms of congenital malformations. One limitation of this study was that nearly all (98%) of the surgery procedures were gastric bypass surgery, so it is not clear as to whether these findings apply to other types of bariatric surgery. While the study found that bariatric surgery was associated with reduced risks of large-for-gestational-age infants as well as gestational diabetes, bariatric surgery was also associated with increased odds of small-for-gestational age infants, so increased attention during these pregnancies is recommended.