Stocks rose on Tuesday as investors snapped up beaten-down shares while reassuring results from Home Depot Inc boosted sentiment a day after Wall Street sank to a 12-year low.

The benchmark S&P 500 index <.SPX> held a slight edge above its November bear market low as an advance in such shares as Bank of America and JPMorgan Chase eclipsed news that consumer confidence plunged to a record low in February.

Investors took the market's recent sharp falls as signaling an opportunity to snap up cheap shares, with financials among the standout beneficiaries.

JPMorgan, up more than 2 percent, and Citigroup , up 2 percent, led the financial sector advance. The KBW Banks index <.BKX> was up more than 1 percent, rebounding from multiyear lows.

In congressional testimony, Federal Reserve Chairman Ben Bernanke said the economy was in a severe contraction and warned that the U.S. recession may not end this year unless government efforts to restore financial stability succeeded.

I'm not sure data and fundamentals can get much worse. And the government has basically stated that it will continue to fund these companies and banks and they are going to see them through this, said Carl Birkelbach, head of Birkelbach Management in Chicago. I can't see how it could get much worse.

The Dow Jones industrial average <.DJI> rose 120.27 points, or 1.69 percent, to 7,235.05. The Standard & Poor's 500 Index <.SPX> gained 14.61 points, or 1.97 percent, to 757.94. The Nasdaq Composite Index <.IXIC> added 28.96 points, or 2.09 percent, to 1,416.68.

Shares of Home Depot, up more than 8 percent to $20.24, were a top boost to the Dow after the leading home improvement chain's quarterly operating profit topped analysts' estimates.

JPMorgan climbed 2.7 percent to $20.04 after Citigroup raised its first-quarter profit view on the bank. After the bell on Monday JPMorgan announced an 87 percent cut in its dividend to conserve capital and said it has been solidly profitable this quarter.

Shares of energy companies, beaten down along with oil prices on fears a deepening recession will hurt energy demand, rebounded, sending Exxon Mobil Corp up 2.4 percent to $70.92. U.S. front-month crude was up 1.1 percent to $38.77 a barrel.

(Additional reporting by Chuck Mikolajczak)