Magnesium sulfate is used as a tocolytic, but clinical efficacy has been seriously questioned. Our objective was to use controlled ex vivo conditions and known pregnancy stages, to investigate how 2 key factors, hormones and gestation, affect magnesium’s tocolytic ability. We hypothesized that these factors could underlie the varying clinical findings around magnesium’s efficacy. Myometrial strips were obtained from nonpregnant (n = 10), mid-pregnant (n = 12), and term-pregnant (n = 11) mouse uterus. The strips were mounted in organ baths superfused with oxygenated physiological saline at pH 7.4 and 37 °C. The effect of different concentrations of MgSO4 (2-20 mM) was examined on spontaneous and oxytocin-induced (0.5-1 nM) contractions. Contractile properties (amplitude, frequency, and area under the curve) were measured before and after application of magnesium. Magnesium sulfate had a dose-dependent inhibitory effect on both spontaneous and oxytocin-induced contractions but was less effective in the presence of oxytocin. In spontaneous contractions, magnesium was more potent as gestation progressed (P < .0001). In the presence of oxytocin, however, there were no significant gestational differences in its effects on contraction. The rapid onset and reversal of magnesium’s effects suggest an extracellular action on calcium entry. Taken together, we conclude that magnesium’s actions are influenced by both gestational state and hormones, such that, at least in mice, it is least effective in early gestation with oxytocin present and most effective at term in the absence of oxytocin. That magnesium is least effective preterm and oxytocin decreases its effectiveness throughout gestation, may explain its disappointing clinical effects as a tocolytic.