Despite firmer oil prices, the energy sector <.SPTTEN> gave up earlier gains to decline 0.2 percent as shares of Enbridge Inc (>> Enbridge Inc) fell 0.9 percent to C$55.43 ahead of the company's earnings after the bell.

Enbridge also won U.S. antitrust approval for a merger with Spectra Energy Corp (>> Spectra Energy Corp.).

Barrick (>> Barrick Gold Corp.) was the biggest lift on the index, jumping 6.1 percent to C$26.81, the day after the miner announced stronger-than-anticipated profit and a debt reduction plan.

Goldcorp Inc (>> Goldcorp Inc.) also drove the market higher as lower costs at its gold mines in the Americas helped its quarterly profit beat expectations. Its stock was up 5.9 percent at C$23.11.

The surge in the shares of the two companies gave the materials sector <.GSPTTMT> a 0.4 percent lift and sent the gold subindex <.SPTTGD> up 1.8 percent.

"The earnings I've been seeing for the most part in Canada and the U.S. have been pretty good," said Barry Schwartz, vice president and portfolio manager at Baskin Financial Services in Toronto.

"We're seeing companies very disciplined on their costs and being cautiously optimistic for 2017."

The Toronto Stock Exchange's S&P/TSX composite index <.GSPTSE> ended up 19.22 points, or 0.12 percent, at 15,864.17. Of the index's 10 main groups, six were in positive territory.

With the slight gain, Bay Street recorded a record close, the fifth session in a row the index has ended at a fresh high.

But a drop in shares of Sun Life Financial Inc (>> Sun Life Financial Inc) restrained overall market gains after the insurer reported a drop in quarterly underlying profit. Sun Life was down 5.1 percent at C$49.94.

Bombardier (>> Bombardier, Inc.) fell 3.1 percent to C$2.50 after it posted lower-than-expected revenue on weak demand in its rail and business aircraft divisions.

Bombardier has struggled in recent years as it brings its new CSeries jet program to the market. The Canadian government agreed last week to provide aid to the company.

(Editing by Phil Berlowitz)

By Leah Schnurr