Canada's main stock index edged up on Thursday to a three-week high, boosted by a bump in shares of Rogers Communications Inc (RCIb.TO) after it beat earnings expectations, while energy shares lost ground as oil prices fell.

Telecom and cable company Rogers rose 1.4 per cent to $64.88 after reporting better-than-expected quarterly profit on the back of strong growth in its wireless business that offset declines in cable.

Canadian Pacific Railway Ltd (CP.TO) also gained on better-than-expected quarterly profit, which it reported late on Wednesday, although executives expressed concern about grain shipments for the second half of the year. The company's shares rose 0.5 per cent to $204.70.

Investors are assessing second-quarter earnings "to get an indication of whether the market can keep on an upward trajectory for the rest of the year," said Luciano Orengo, portfolio manager at Manulife Asset Management.

The Toronto Stock Exchange's S&P/TSX composite index ended up 19.93 points, or 0.13 per cent, at 15,264.64, its highest close since June 28.

Still, the index has dipped 0.2 per cent for the year, lagging most other major markets, including the S&P 500 which has climbed 10.5 per cent.

"To get the TSX out of this lull, you need energy to start contributing to returns," Orengo said.

Energy shares fell 0.8 per cent as oil prices fell.

U.S. crude oil futures settled 0.7 per cent lower at US$46.79 a barrel as nagging worries about abundant global crude supplies weighed.

Shares of Hydro One Ltd (H.TO) overcame earlier losses to end up 0.6 per cent at $22.67. The electric utility said late on Wednesday it would buy rival Avista Corp for about $4.3 billion to expand into the U.S. Northwest.

Seven of the index's 10 main groups ended higher.

Financials added 0.2 per cent, helped by gains for some of the country's major banks. The materials group, which includes precious and base metals miners and fertilizer companies, also rose 0.2 per cent.

Shares of BlackBerry Ltd (BB.TO) dipped 0.1 per cent to $12.77 despite the company saying it had won the right to sell tools for encrypting phone calls and text messages to the U.S. government.

Exchange Income Corp (EIF.TO), a target of short seller Marc Cohodes, fell 8.2 per cent to $30.33 after reporting second-quarter earnings late on Wednesday.