Stocks slightly trimmed gains on Wednesday after the Federal Reserve in its policy statement said it was extending purchases of long-term U.S. Treasury debt to the end of October.

The Dow Jones industrial average <.DJI> gained 123.71 points, or 1.34 percent, to 9,365.16. The Standard & Poor's 500 Index <.SPX> climbed 12.41 points, or 1.25 percent, to 1,006.76. The Nasdaq Composite Index <.IXIC> rose 31.07 points, or 1.58 percent, to 2,000.80.

(Editing by Leslie Adler)