This study protocol describes a randomized controlled trial to assess whether magnesium sulfate compared to placebo administered to women at risk of preterm birth between 30-34 weeks reduces the risk of death or cerebral palsy in children at two years of age. The trial will randomize over 1676 women to receive either magnesium sulfate or placebo by IV infusion within 24 hours of planned or expected preterm birth. The primary outcome will be death or cerebral palsy in children at two years of age. The trial aims to provide evidence on whether the neuroprotective benefits of magnesium sulfate seen at earlier gestations apply at 30-34 weeks.