By Fergal Smith
TORONTO (Reuters) - Canada's main stock index edged higher on Wednesday as optimism that a U.S. debt-ceiling deal could be reached offset worries around higher inflation and a pullback in energy stocks, with the index recouping earlier losses.
The Toronto Stock Exchange's S&P/TSX composite index ended up 8.23 points, or 0.04%, at 20,191.66, along with a higher close on Wall Street.
Top U.S. Senate Republican Mitch McConnell said his party would support an extension of the federal debt ceiling into December. This would head off a historic default that would exact a heavy economic toll.
Investor sentiment has been tested in recent days by a selloff in technology shares, the potential for the Federal Reserve to reduce economic stimulus and worries that surging energy prices would boost inflation pressures, derailing global economic recovery.
On Monday, the Toronto market posted its lowest closing level in two and a half months at 20,052.25.
But some technical indicators, such as measures of breadth, have showed encouraging signs, said Sid Mokhtari, a market technician at CIBC World Markets.
"We think market internals have reached a point where we're getting close to some sort of a trough," Mokhtari said.
The information technology group rose 1%, while the materials sector, which includes precious and base metals miners and fertilizer companies, added 0.6%.
Energy declined 2.2%, pulling back from its highest level in more than two years the day before.
U.S. oil futures settled 1.9% lower at $77.43 a barrel as an unexpected rise in U.S. crude inventories prompted buyers to take a breather after recent torrid gains.
The heavily-weighted financial services sector ended 0.2% lower.
(Reporting by Fergal Smith; Additional Reporting by Amal S in Bengaluru; Editing by Marguerita Choy)