TORONTO - The Toronto stock market staged a stunning turnaround Wednesday as bargain hunters moved in mid-afternoon, enabling the TSX to overcome a plunge of almost 200 points to close higher.

The market had been in a deep funk ahead of a gathering of European Union leaders. Traders were skeptical the leaders could come up with a plan to contain the eurozone debt crisis.

The S&P/TSX composite index closed up 113.01 points to 11,564.8, led by a sharp gain in mining shares even as prices for oil and copper hit fresh, multi-month lows.

"You can only go down so far and then all of a sudden, some group looks at this and says stocks are down at the area where they're attractive," said Fred Ketchen, manager of equity trading at Scotia Capital.

The TSX Venture Exchange climbed 9.73 points to 1,256.48.

The Canadian dollar was also off the worst levels of the session, down 0.23 of a cent to 97.64 cents US. It had earlier moved as low as 97.13 cents US, its lowest level since December, as investors sought safety in U.S. Treasuries and avoided riskier trades such as stocks, commodities and resource-based currencies like the loonie.

The currency failed to benefit from a retail sales report for March that met expectations. Statistics Canada said retail sales rose 0.4 per cent to $39.1 billion in March, more than offsetting a decline in February.

U.S. markets had also been deep in the red on mounting worries that Greece will be forced to exit the eurozone but closed well off the worst levels of the session. The Dow Jones industrial average slipped 6.66 points to 12,496.15.

The Nasdaq composite index gained 11.04 points to 2,850.12 and the S&P 500 index was ahead 2.23 points at 1,318.86.

The TSX has had a dreadful month on worries about the eurozone and a slowing global economy. The main index is down 9.2 per cent from its highs of late February and down 6.2 per cent for this month alone on worries about the eurozone and a slowing global economy.

Leaders of the 27 EU countries are meeting for a summit that will focus on Europe's economic woes and Greece's political crisis.

They have said that everything will be on the table, including a discussion about whether 17 countries that use the euro should borrow money jointly -- issuing so-called "eurobonds."

But expectations were low for agreement on concrete measures to boost growth and stability in the eurozone.

The summit takes place against a background of increasing worries about Greece's future in the eurozone.

An election slated for June 17 is widely considered to be a referendum on the country's membership in the euro. The main concern is that political parties that are against the terms of the country's bailout package will win the election. If Europe then cuts funding to Greece, the country may face a messy exit from the euro, raising concerns that other countries might follow.

"Europe is the problem," added Ketchen, "and Europe will remain a big problem until they get their heads straightened out and grow up and become mature in their attitude toward their own economies and that of their own region."

Worries about the eurozone have taken a heavy toll on stock and commodity markets this month. The TSX has plunged almost 900 points or seven per cent.

Bullion prices also continued to retreat, down another $28.20 to US$1,548.40 an ounce but the gold sector jumped about 4.5 per cent and Goldcorp Inc. (TSX:G) ran up $2.50 to C$38.40.

A higher U.S. dollar has also pressured commodity prices. A stronger greenback usually helps depress prices for oil and metals, which are denominated in dollars, as it makes those commodities more expensive for holders of other currencies.

The base metals sector was up 3.22 per cent even as the July copper contract on the Nymex dropped nine cents to US$3.40 a pound -- down 11 per cent this month and its lowest level since the end of 2011. Teck Resources (TSX:TCK.B) gained $1.48 to C$31.46.

The energy sector gained 0.65 per cent as the July crude contract on the New York Mercantile Exchange declined $1.95 to US$89.90, its lowest close since last October and down from US$106 at the end of April. Canadian Natural Resources (TSX:CNQ) climbed 45 cents to C$31.45.

Bank of Montreal (TSX:BMO) kicked off the big banks' earnings season with profits that beat expectations. BMO's second-quarter net income was up 27 per cent from the same time last year, rising by $215 million to nearly $1.03 billion. After adjustments, BMO's net income was $982 million or $1.44 per share, eight cents higher than expectations. Its shares shed early losses to advance 81 cents to $56.06.

The sector gained 0.62 per cent as TD Bank (TSX:TD) gained 90 cents to $78.73.

Meanwhile, federal Labour Minister Labour Lisa Raitt said the government is making preparations to table back-to-work legislation to end the strike by some 4,800 workers at Canadian Pacific Railway (TSX:CP), which started just after midnight. But she is urging both sides to keep talking to come to an agreement. Its shares added seven cents to $74.99.

In other corporate news, Canaccord Financial Inc. (TSX:CF) reported a fourth-quarter loss of $31.8-million or 42 cents a share. Excluding those items, adjusted net income was $2.1 million or two cents per common share and its shares fell 27 cents or 4.1 per cent to $6.30.

Stateside, Hewlett-Packard (NYSE:HPQ) announced plans to jettison 27,000 workers, representing HP's largest payroll purge in its 73-year history. The reductions will affect about eight per cent of Hewlett-Packard Co.'s nearly 350,000 employees by the time the overhaul is completed in October 2014.

News of the cutbacks overshadowed the release of HP's latest quarterly results. The company's earnings and revenue were both better than analysts projected. Shares added five per cent or $1.10 to $22.18 in after-hours trading.

Facebook shares were higher after two days of sharp losses in the wake of its trading debut Friday. Its stock, originally priced at US$38, was up $1 to US$32 after falling almost nine per cent Tuesday.

Meanwhile, a group of shareholders have filed a lawsuit against Facebook, its executives and Morgan Stanley, the IPO's lead underwriter. The suit claims the company's IPO documents contained untrue statements and omitted important facts, such as a "severe reduction in revenue growth" that Facebook was experiencing at the time of the offering.