Canada's main stock index rose to a four-month high on Monday as higher oil prices boosted energy shares, while the heavyweight financials group also gained, offsetting declines for industrial and information technology names.

The Toronto Stock Exchange's S&P/TSX composite index closed up 62 points, or 0.4 per cent, at 15,516.23, its highest close since May 12.

Gains for the index came despite a selloff in technology shares and North Korea tensions that weighed on Wall Street.

"Canada is getting a little bit more attractive from a valuation standpoint," said James Robertson, managing director of the portfolio solutions group at Manulife Asset Management. "You are starting to see more capital moving into Canada."

The Toronto market has been held back this year by the lower price of oil and a stronger Canadian dollar.

But the loonie retreated ahead of a speech on Wednesday by Bank of Canada Governor Stephen Poloz, while U.S. crude oil prices reached their highest since April, settling up 3.1 per cent at US$52.22 a barrel.

The energy group climbed 1.7 per cent, with Pembina Pipeline Corp (PPL.TO) rising 3.4 per cent to $43.55 and Encana Corp (ECA.TO) advancing 1.7 per cent to $14.13.

Five of the index's 10 main groups ended higher, with financials gaining 0.2 per cent.

"I think the negativity around the financial names has dissipated," Robertson said.

Investors have worried that a slowdown in Canada's housing market will hold back loan growth for banks.

The materials group, which includes precious and base metals miners and fertilizer companies, added 0.7 per cent as safe-haven buying of gold helped boost gold mining shares.

Bombardier Inc (BBDb.TO) extended previous losses to hit a more than four-month low on news that Siemens AG will likely choose French rival Alstom SA over the Canadian company in a multibillion-dollar rail merger. Montreal-based plane and train maker Bombardier is also awaiting a U.S. court ruling, expected to be made public on Tuesday, on a CSeries dumping complaint by Boeing Co. (BA.N).

Bombardier shares pared some earlier losses but still fell 4.0 per cent to $2.14, while the overall industrials retreated 0.3 per cent.

The technology group declined 1.1 per cent, with Shopify Inc (SHOP.TO) falling 4.6 per cent to $141.64.

Air Canada (AC.TO), which counts fuel as one of its major costs, lost 7.3 per cent to $25.50.