Background Magnesium sulphate given to women immediately prior to very preterm birth protects the perinatal brain, so fewer babies die or develop cerebral palsy. How magnesium sulphate exerts these beneficial effects remains uncertain. The aim of the MagNUM Study was to assess the effect of exposure to antenatal magnesium sulphate on MRI measures of brain white matter microstructure at term equivalent age. Methods Nested cohort study within the randomised Magnesium sulphate at 30 to <34 weeks’ Gestational age Neuroprotection Trial (MAGENTA). Mothers at risk of preterm birth at 30 to <34 weeks’ gestation were randomised to receive either 4 g of magnesium sulphate heptahydrate [8 mmol magnesium ions], or saline placebo, infused over 30 min when preterm birth was planned or expected within 24 h. Participating babies underwent diffusion tensor MRI at term equivalent age. The main outcomes were fractional anisotropy across the white matter tract skeleton compared using Tract-based Spatial Statistics (TBSS), with adjustment for postmenstrual age at birth and at MRI, and MRI site. Researchers and families were blind to treatment group allocation during data collection and analyses. Findings Of the 109 participating babies the demographics of the 60 babies exposed to magnesium sulphate were similar to the 49 babies exposed to placebo. In babies whose mothers were allocated to magnesium sulphate, fractional anisotropy was higher within the corticospinal tracts and corona radiata, the superior and inferior longitudinal fasciculi, and the inferior fronto-occipital fasciculi compared to babies whose mothers were allocated placebo (P < 0.05). Interpretation In babies born preterm, antenatal magnesium sulphate exposure promotes development of white matter microstructure in pathways affecting both motor and cognitive function. This may be one mechanism for the neuroprotective effect of magnesium sulphate treatment prior to preterm birth.