Oil and gas companies, which account for about 20 percent of the index's weight, rallied 1.7 percent as crude prices closed at the highest level in more than two years.

Encana Corp rose 4.4 percent to finish at C$15.09, while Crescent Point Energy Corp rallied 4.5 percent to C$10.61.

"Year-to-date, energy is the worst-performing sector by a long shot," said Manash Goswami, a portfolio manager at First Asset Investment Management Inc. The group has fallen about 12 percent this year. "People are a little bit more confident with crude prices ... It seems the fundamental background for oil is more constructive now."

The Toronto Stock Exchange's S&P/TSX composite index rose 22.81 points, or 0.14 percent, to a record close of 16,025.59. It touched a fresh intraday high of 16,064.68.

Half of the index's 10 primary sectors rose.

"If energy reverses their first-half of the year performance or claws some of it back ... you can see this rally continuing," said Goswami, adding that investors are also seeing a positive growth trend based on quarterly results so far.

The heavily weighted financials group added 0.2 percent.

Canadian Western Bank gained 4.8 percent to C$36.34 following news it is acquiring ECN Capital Corp assets. ECN Capital Corp was up 4.8 percent at C$36.34.

Colliers International Group jumped 7.8 percent to C$75.61 after posting strong quarterly growth.

Healthcare stocks also rallied, climbing 1.7 percent, with cannabis producer Canopy Growth up 6.3 percent to C$16.18, extending the previous session's gains.

Valeant Pharmaceuticals Inc was up 3 percent to C$15.07 after it said it will cut its debt by an additional $125 million, exceeding its previously stated goal of $5 billion, and months ahead of schedule.

Consumer discretionaries added 0.5 percent, with Shaw Communications Inc up 1.7 percent at C$29.46.

On the downside, Shopify Inc slumped 8.5 percent to C$128.26 despite posting strong quarterly results. Investors expressed disappointment it did not do more to address short-seller Citron Research's concerns.

The technology sector lost 1.7 percent.

The materials group, home to mining companies, lost 0.4 percent, in tandem with weaker bullion prices.

Eldorado Gold fell 6.9 percent to C$1.62, while a number of other miners, including Goldcorp Inc and Barrick Gold, fell more than 1 percent.

(Reporting by Solarina Ho; Editing by Dan Grebler)

By Solarina Ho