Stocks leaped on Wednesday after the Federal Reserve surprised Wall Street when it said it will buy long-term Treasury bonds for the first time in four decades in an effort to revive the recession-hit economy.

The Fed's move, aimed at resuscitating lending, drove the yield on the 10-year U.S. Treasury note to its biggest one-day drop since the 1987 stock market crash and 30-year mortgage rates fell to around their lowest levels on record.

Shares of financial companies and home builders gave the market some of the biggest lifts as investors bet that the Fed's move would kick-start lending. Bank of America Corp shares soared 22.3 percent to $7.67 while home builder D.R. Horton Inc rose 7.7 percent to $9.07.

It potentially has the opportunity to lower mortgage rates, which would widen the potential pool of buyers for homes, said Bucky Hellwig, senior vice president at Morgan Asset Management in Birmingham, Alabama.

The Dow Jones industrial average <.DJI> gained 90.88 points, or 1.23 percent, to 7,486.58. The Standard & Poor's 500 Index <.SPX> advanced 16.23 points, or 2.09 percent, to 794.35. The Nasdaq Composite Index <.IXIC> rose 29.11 points, or 1.99 percent, to 1,491.22.

The rally in stocks was another step forward in the bounce off of 12-year lows reached earlier this month.

The Fed said it will buy up to $300 billion worth of longer-term U.S. government debt over the next six months and expand purchases of mortgage-related debt to help ease credit market conditions in its latest action to lower borrowing costs.

An easing of credit market strains would help business and consumer spending. The Fed's announcement came after its policy-makers concluded a two-day meeting.

Even so, the Fed's move still managed to stoke inflation worries, sending gold prices up more than 3 percent after hitting lows not seen since January on an intra-day basis.

The Nasdaq was driven higher by possible deal activity after the Wall Street Journal reported that IBM was likely to pay $10 to $11 per share to buy the computer maker Sun Microsystems. The price implies a premium of more than 100 percent from Sun Micro's closing price on Tuesday.

Shares of Sun Microsystems surged nearly 79 percent to $8.89 on Nasdaq, while IBM's stock shed 1 percent to $91.95 on the New York Stock Exchange.

During the session, the S&P had risen by as much as 3.2 percent and climbed above the 800 mark on an intraday basis for the first time in a month.

The KBW Bank index <.BKX> jumped 11.1 percent and the S&P Financial index <.GSPF> gained 10.1 percent.

The Dow Jones home construction index <.DJUSHB> climbed 8.3 percent.

Trading was heavy on the New York Stock Exchange, with about 2.08 billion shares changing hands, above last year's estimated daily average of 1.49 billion, while on Nasdaq, about 2.78 billion shares traded, above last year's daily average of 2.28 billion.

Advancing stocks outnumbered declining ones on the NYSE by a ratio of more than 4 to 1, while on the Nasdaq, more than two stocks rose for every one that fell.

(Additional reporting by Edward Krudy; Editing by Jan Paschal)