U.S. stocks rallied but lost steam on Wednesday after the Federal Reserve said it would keep rates near zero for an extended period even as it expressed confidence in the economic recovery.

* The Dow Jones industrial average <.DJI> gained 29.92 points, or 0.31 percent, to end unofficially at 9,801.83. The Standard & Poor's 500 Index <.SPX> gained 1.09 points, or 0.10 percent, to finish unofficially at 1,046.50. But the Nasdaq Composite Index <.IXIC> dropped 1.80 points, or 0.09 percent, to close unofficially at 2,055.52.

(Reporting by Edward Krudy; Editing by Jan Paschal)