The Toronto stock market closed sharply higher Tuesday on a new round of optimism that European leaders are set to unveil a comprehensive fix to the government debt crisis and the dangers it poses to the region’s banks.

It was a wild day on markets with the S&P/TSX composite index coming back from a 167-point slide to move up 130.07 points at 12,053.11 and the TSX Venture Exchange moved points 10.26 points higher to 1,551.75.

Indexes took off in the final hour of the session following a report in Britain’s The Guardian newspaper that France and Germany have agreed to a C$2-trillion rescue fund.

The Canadian dollar also came back from early losses, rising 0.74 of a cent to 98.58 cents US.

Bank stocks also helped U.S. markets advance with the Dow Jones industrials charging ahead 180.05 points to 11,577.05.

The Nasdaq composite index was up 42.51 points to 2,657.43 while the S&P 500 index rose 24.52 points to 1,225.38.

Indexes have seesawed over the last week on speculation that Europe was finally set to tackle the debt crisis once and for all.

“We’re just going to keep getting these stories and posturing and statements and everything else until the European Union has its meeting (this weekend) and we see what comes out of it, if anything, then it’s all speculation,” said Colin Cieszynski, market analyst at CMC Canada.

“You end up with everybody just overreacting to each little piece of news, trying to find something to grasp onto.”

Hopes had been lifted last week that the 17 countries that use the euro, led by Germany and France, were preparing a solution to the debt crisis that would also recapitalize a large part of the banking sector and get the banks to take a bigger hit on their Greek debt holdings.

But those hopes were dashed on Monday when German officials, including the finance minister, cautioned investors against believing that Sunday’s summit of eurozone leaders in Brussels would mark a definitive turning point in the crisis.

Investors also shook off earlier worries about how slowing Chinese growth would impact on the global economic revival.

Resource stocks and prices for oil and metals had initially declined sharply as a reading of China’s rapid growth suggested it slowed slightly to a still-strong 9.1% during the third quarter, down from the previous quarter’s 9.5% and the lowest level in two years.

The government said that was in line with plans to steer growth that hit 10.3% last year to a more sustainable level and cool politically dangerous inflation.

However, a slowing Chinese economy is viewed as bad news for much of the rest of the world, which has counted on strong growth to help fuel a global economic recovery. On a brighter note, analysts noted that the Chinese data at least lessened fears that the country’s economy is heading for a hard landing.

“I didn’t understand why people would be upset with 9.1% growth,” said Colin Cieszynski, market analyst at CMC Canada.

“If it could manage 9.1% in the third quarter with all the uncertainty and volatility that was going on, that was fantastic.”

Commodity prices usually react negatively for at least a short period on signs of faltering growth in China since strong demand from the world’s second-biggest economy has supported higher prices for oil and metals and in turn rising share prices on the resource-heavy TSX.

The base metal sector rose 2.73% as the December copper contract on the New York Mercantile Exchange came back from early lows to move two cents lower to US$3.36 a pound.

Teck Resources (TSX:TCK.B) gained 66 cents to $35.95 and HudBay Minerals (TSX:HBM) gained 48 cents to $10.99.

The energy sector gained 2.61% as the November contract for crude on the New York Mercantile Exchange moved ahead $1.96 to US$88.34 a barrel. Suncor Energy (TSX:SU) gained 84 cents to $30.60 and Cenovus Energy (TSX:CVE) climbed 48 cents to $36.03.

The industrials sector was ahead 2.5% amid rising railroad stocks. Canadian Pacific Railway (TSX:CP) up $2.64 to $56.08 and Canadian National Railways (TSX:CNR) advanced $2.15 to $74.65.

The gold sector was weak as bullion prices faded with December gold down $23.80 to US$1,652.80 an ounce. Barrick Gold Corp. (TSX:ABX) shed 48 cents to $47.80 and Goldcorp Inc. (TSX:G) stepped back 33 cents to $47.76.

In New York, Bank of America Corp. rose 10.1% after it beat Wall Street earnings expectations for third quarter thanks to accounting gains and the sale of a stake in a Chinese bank. Goldman Sachs rose 5.5%, even after reporting only its second quarterly loss since going public in 1999.

In other corporate news, Research In Motion shares gained 69 cents to $23.59 as the company unveiled a new operating system for its next-generation BlackBerry smartphones called BBX, based on the software already running RIM’s PlayBook tablet.