Stocks rose on Tuesday after six losing sessions had pushed them to a 12-year low, as investors bought beaten-down shares, taking comfort from Fed Chairman Ben Bernanke's commitment to keep banks healthy.

Bernanke said in testimony to the U.S. Senate Banking Committee that the Federal Reserve -- the U.S. central bank -- was committed to ensuring the viability of all major financial institutions.

Uncertainty about the future of the U.S. banking system had dragged the Dow and S&P 500 indexes down to 1997 lows.

The plan out of the administration with Bernanke's backing seems to have some rationality and the market is factoring that there is something here that might potentially work, said Greg Palmer, head of equity trading at Pacific Crest Securities in Portland, Oregon.

Among financials, Citigroup rose 9.4 percent to $2.34 and contributed to a 3.3 percent rise in the S&P financials index <.GSPF>.

The Dow Jones industrial average <.DJI> rose 77.02 points, or 1.08 percent, to 7,191.80. The Standard & Poor's 500 Index <.SPX> added 9.28 points, or 1.25 percent, to 752.61. The Nasdaq Composite Index <.IXIC> gained 16.88 points, or 1.22 percent, to 1,404.60.

The S&P 500 held a slight edge above its November intraday bear market low, even after news that consumer confidence plunged to a record low in February.

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 estimates.

Crude oil futures were mostly flat but Exxon Mobil Corp rose 2.4 percent to $70.92 and Chevron added 3.3 percent to $64.99. OPEC oil supply is likely to fall as the group's members enforce a deal to cut output, increasing its scope to lower production further at a March 15 meeting.

The S&P energy index <.GSPE> rose 2.8 percent.

Investors also snapped up bargains in the technology sector, and big names like Apple Inc , and Google Inc rose more than 2 percent.

Tuesday's slight increase brings little relief to U.S. stocks, however, down to about half their market value from peaks reached in October 2007.

Since then, the Dow Jones Wilshire 5000 index <.DWCF> -- one of the broadest measures of U.S. stocks -- is down more than 50 percent or about $10 trillion.

Bernanke warned on Tuesday the severe U.S. recession may drag into 2010 unless the government succeeds in stabilizing the banking system and financial markets with strong action.

(Editing by James Dalgleish)