May 21 (Reuters) - Canada's main stock index rose on Thursday, with the index moving closer to the record closing high it posted nearly three months ago as financial and consumer discretionary shares climbed.

The Toronto Stock Exchange's S&P/TSX composite index ended up 247.67 points, or 0.7%, at 34,409.49, marking the highest closing level since the index notched an all-time peak on March 2.

o Wall Street's main indexes clawed back some earlier declines to end higher as investors hoped for a Middle East peace deal even as the U.S. and Iran took directly opposing stances over Tehran's uranium stockpile and controls on the Strait of Hormuz.

o "Until there's a resolution, markets are likely to continue tracking headlines around the conflict," said Corbin Footitt, a portfolio manager at Verecan Capital Management Inc. "But we're still holding our course because Canada remains the cleanest commodity play in the Western world."

o Heavily weighted financials advanced 1.1%, with shares of Bank of Montreal adding 1.5%.

o Canada's major banks are due to report quarterly earnings next week.

o Shares of auto parts supplier Magna International Inc. gained 4.1%, helping to lift the consumer discretionary sector by 1.6%.

o Utilities added 1.2% as bond yields fell. The Canadian 10-year yield eased 4.1 basis points to 3.550%.

o Energy dipped 0.1% as the price of oil settled 1.9% lower at $96.35 a barrel, but the sector was up 46.1% since the start of the year.

o Canada has become more attractive for oil and gas investment under Prime Minister Mark Carney although the cost of doing business remains a challenge that could limit long-term energy sector growth, industry executives said.

o Lightspeed Commerce Inc. shares fell 6.6% after the point of sale platform provider missed quarterly profit estimates.

(Reporting by Fergal Smith in Toronto Tharuniyaa Lakshmi in Bengaluru; Editing by Jonathan Ananda and Deepa Babington)

By Tharuniyaa Lakshmi and Fergal Smith