As many more premature infants survive, the numbers of these infants with health problems increases. The rate of cerebral palsy (CP) in extremely premature infants is approximately 20%. Magnesium sulfate, the most commonly used drug in the US to stop premature labor, may prevent CP. This trial tests whether magnesium sulfate given to a woman in labor with a premature fetus (24 to 31 weeks out of 40) will reduce the rate of death or moderate to severe CP in the children at 2 years. The children receive ultrasounds of their brains as infants and attend three follow-up visits over two years to assess their health and development.