Background Antenatal magnesium sulfate is widely used as a tocolytic, for maternal seizures, and for seizure prophylaxis in preeclampsia. Recent studies have suggested that antenatal magnesium sulfate use is associated with favorable neurodevelopmental outcomes in preterm infants. However, there are concerns regarding the neonatal effects of antenatal magnesium sulfate, especially regarding gastrointestinal morbidities. This study aims to explore the effects of antenatal magnesium sulfate on intestinal morbidities requiring surgery in preterm infants.Methods This was a retrospective cohort study of 181 preterm infants who were born at less than 28 weeks of gestational age. Subjects were categorized as infants exposed to antenatal magnesium sulfate and those not exposed to antenatal magnesium sulfate.Results Antenatal magnesium sulfate was associated with a lower incidence of surgical conditions of the intestine (OR 0.393, 95% CI 0.170–0.905). Multivariate analysis showed that the duration of antenatal magnesium sulfate use was associated with surgical conditions of the intestine (adjusted OR 0.766, 95% CI 0.589–0.997). In the < 26 weeks of gestational age subgroup, use of antenatal magnesium sulfate was significantly associated with decreased intestinal morbidities requiring surgery (adjusted OR 0.234, 95% CI 0.060–0.922).Conclusion Antenatal magnesium sulfate use appears to have a protective effect on intestinal morbidities requiring surgery in preterm infants in a duration-dependent manner. Association of antenatal magnesium sulfate use and decreased intestinal morbidities requiring surgery was more distinct in preterm infants < 26 weeks of gestational age.