U.S. stocks climbed on Wednesday after grim growth data offered hints of future expansion, a prospect reinforced by the Federal Reserve's hopeful comments.

Gross domestic product dropped at a 6.1 percent annual rate in the first quarter, but the data showed consumer spending rose and a decline in inventories suggested manufacturers and retailers will have to stock up in merchandise.

The data drove shares of big manufacturers sharply higher. Boeing Co gained 4.4 percent to $40.55 and United Technologies rose 2 percent to $48.91.

The central bank backed up the positive sentiment when its policy meeting concluded and the Fed said the economic outlook had improved modestly since its last meeting in March.

It's a good read on the economy, it's good for stocks. It follows along all of the 'green shoots' that we've been seeing, it reinforces that, said Rick Campagna, portfolio manager at Provident Investment Council in Pasadena, California.

The Dow Jones industrial average <.DJI> gained 168.78 points, or 2.11 percent, to 8,185.73. The Standard & Poor's 500 Index <.SPX> gained 18.48 points, or 2.16 percent, to 873.64. The Nasdaq Composite Index <.IXIC> gained 38.13 points, or 2.28 percent, to 1,711.94.

Wal-Mart was among the stocks giving the biggest lifts to the Dow, up 4.1 percent at $50.45, as the world's largest retailer said that 17 percent of measurable traffic in February came from new households.

Before the Fed's announcement, the S&P 500 broke through a significant resistance around the 875 level, a key technical point the S&P had tried but failed to break in recent days.

The move marked the highest level for the broad index in 3-1/2 months. A sustained move above that level could lead to even more gains, according to some analysts.

The Dow scored its highest close since February, while for the S&P 500, Wednesday marked its highest finish since January.

The Nasdaq, up 8.6 percent for the year, closed at its highest level since November 4.

Shares of tech bellwethers helped lift the Nasdaq, with Qualcomm up 2 percent at $$43.08 and Apple Inc up 1 percent at $125.14.

Energy shares also provided support to stocks as the price of crude rose back above $50 a barrel following a much larger- than-expected decline in gasoline supplies. Energy behemoths Exxon Mobil and Chevron climbed, with Exxon up 2 percent at $68.44 and Chevron up 2.4 percent at $67.56.

As the market awaits the results of the government's stress tests on the health of major U.S. banks, some traders say a more concrete sense of where banks' strengths and weaknesses are make investment decisions easier. The KBW bank index <.BKX> rose 5 percent, led by JPMorgan Chase & Co , up 5.2 percent at $34.48.

Trading was moderate on the New York Stock Exchange, with about 1.48 billion shares changing hands, slightly below last year's estimated daily average of 1.49 billion, while on Nasdaq, about 2.40 billion shares traded, above last year's daily average of 2.28 billion.

Advancing stocks outnumbered declining ones on the NYSE by 2,560 to 484 while on the Nasdaq, advancers beat decliners by

2,073 to 604.

(Additional reporting by Leah Schnurr)

(Reporting by Chuck Mikolajczak; Editing by Jan Paschal)