Children who survive preterm birth face life-long health problems and increased educational needs, often related to abnormalities of brain development around the time of birth. Magnesium sulphate given to women immediately prior to preterm birth at or before 30 weeks' gestation protects the fetal brain, so fewer babies die or develop cerebral palsy. It is not known exactly how magnesium exerts this benefit. The MagNUM Study, a nested study within a multicentre randomised trial of antenatal magnesium sulphate prior to preterm birth at 30 to 34 weeks' gestation, will assess the possible mechanism of effect of magnesium treatment by a MRI scan of the baby's brain at term-equivalent age. We will assess whether magnesium reduces brain injury, particularly in brain regions that control movement, learning and behaviour, and relate these changes in brain structure to later development.