Wall Street advanced on Thursday, boosted by an unexpected rise in pending U.S. home sales and a dip in jobless claims, but trading was volatile as investors awaited a key vote in Congress on a plan to prevent a U.S. default.

The rebound comes a day after U.S. stocks recorded their biggest fall in eight weeks. Uncertainty over Washington's ability to agree on a plan to reduce the U.S. budget deficit before an August 2 deadline has kept investors nervous about the possibility of a debt default or a U.S. credit ratings downgrade.

A bill to cut the U.S. deficit and raise the debt limit is expected after the close of trading on Thursday. U.S. House of Representatives Speaker John Boehner is pushing to pass a bill in the Republican-majority House, while the Democratic-controlled Senate is crafting a competing bill.

Volatility and volume are reflecting avoiding risk right now and waiting on clarity, said Marc Pado, U.S. market strategist with Cantor Fitzgerald & Co in San Francisco. It's mainly just a watching-and-waiting kind of situation until the vote.

The Dow Jones industrial average <.DJI> was up 64.94 points, or 0.53 percent, at 12,367.49. The Standard & Poor's 500 Index <.SPX> was up 10.16 points, or 0.78 percent, at 1,315.05. The Nasdaq Composite Index <.IXIC> was up 32.56 points, or 1.18 percent, at 2,797.35.

It looks like the market is increasingly comfortable with plan B, said Jack Ablin, chief investment officer at Harris Private Bank in Chicago, of the stocks' midday gains. We're seeing some of the increased, improving optimism. The prospects for this market right now are flapping in the hot air of Washington.

Exxon Mobil Corp , the world's largest publicly traded oil company, said higher oil prices contributed to a rise in its second-quarter profit, but results fell short of expectations. The stock fell 1.4 percent to $82.17.

Pending sales of existing U.S. homes unexpectedly rose 2.4 percent in June from May and were up sharply from a year ago, a real estate trade group said on Thursday.

The Dow Jones U.S. Home Construction Index <.DJUSHB> rose 3.1 percent, while the iShares Dow Jones U.S. Real Estate Trust gained 0.4 percent.

New weekly claims for unemployment benefits fell below 400,000 for the first time since early April.

(Editing by Kenneth Barry)