U.S. stocks extended gains on Tuesday, with the Nasdaq Composite up 2 percent and the Dow and S&P 500 at session highs as optimism over a confidence vote for Greece and better-than-expected housing data boosted investor appetite for equities.

The Dow Jones industrial average <.DJI> gained 115.38 points, or 0.96 percent, to 12,195.76. The Standard & Poor's 500 Index <.SPX> rose 17.55 points, or 1.37 percent, to 1,295.91. The Nasdaq Composite Index <.IXIC> jumped 51.78 points, or 1.97 percent, to 2,681.44.

Expectations that a default of Greek debt could be avoided supported the market for a second day. Consensus grew that Prime Minister George Papandreou would survive a confidence vote in Greece's parliament, easing fears about the euro zone debt crisis that have weighed on the market for months.

(Reporting by Rodrigo Campos, Editing by Chizu Nomiyama)