Canada's main stock index edged up on Thursday to notch a fresh record high as Barrick Gold Corp jumped on the company's better-than-expected profits, though a drop in shares of Sun Life helped keep overall gains in check.

Despite firmer oil prices, the energy sector gave up earlier gains to decline 0.2 per cent as shares of Enbridge Inc fell 0.9 per cent to $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.

Barrick was the biggest lift on the index, jumping 6.1 per cent to $26.81, the day after the miner announced stronger-than-anticipated profit and a debt reduction plan.

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 per cent at $23.11.

The surge in the shares of the two companies gave the materials sector a 0.4 per cent lift and sent the gold subindex up 1.8 per cent.

"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 ended up 19.22 points, or 0.12 per cent, 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 restrained overall market gains after the insurer reported a drop in quarterly underlying profit. Sun Life was down 5.1 per cent at $49.94.

Bombardier fell 3.1 per cent to $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.  

U.S. MARKETS

The Dow Jones Industrial Average scored its sixth straight record high on Thursday, but just barely, while the S&P 500 edged lower due to declining energy stocks.

It was a mixed day on Wall Street as investors digested recent gains and sold banks that have been big winners in the "Trump rally" that has seen the S&P 500 rise about five per cent so far in 2017, with the Dow Jones Industrial Average up four per cent.

Signs of an improving economy and promises by President Donald Trump to cut corporate taxes and reduce financial regulations have been behind much of the recent gains. Now, with a strong fourth-quarter earnings season mostly complete, many investors say they need concrete signs of progress from Trump to justify more gains.

"Some of the excitement and enthusiasm over earnings and those Trump growth initiatives is starting to shift to more practical, day-to-day events," said Jeff Kravetz, a Phoenix-based regional investment director of the Private Client Reserve at U.S. Bank.

The energy sector declined 1.37 per cent, following oil prices lower as traders weighed swelling U.S. inventories against possible renewed efforts by major oil producers to reduce a price-sapping glut.

The S&P 500 consumer discretionary index lost 0.44 per cent, with TripAdvisor sinking 10.97 per cent after posting lower-than-expected quarterly revenue and profit.

The consumer discretionary index is trading at almost 19 times expected earnings, while the S&P 500 is trading at 17 times expected earnings, according to Thomson Reuters Datastream.

Cisco Systems rose 2.38 per cent after its quarterly report late the day before, helping push the Dow into positive territory by the close of trading after spending most of the day with a loss.

The Dow Jones Industrial Average ended up 0.04 per cent to close at 20,619.77, its sixth straight record-high close. The S&P 500 had lost 0.09 per cent to 2,347.22 and the Nasdaq Composite dropped 0.08 per cent to 5,814.90.

Wells Fargo slipped 0.73 per cent after Credit Suisse downgraded its stock to "neutral" from "outperform."

NetEase jumped 14.08 per cent following the Chinese online game developer's revenue beat.

Fourth-quarter earnings for S&P 500 companies have risen about 7.3 per cent, the strongest expansion since the third quarter of 2014, according to Thomson Reuters data. Analysts on average expect S&P 500 earnings for the first quarter to rise 10.7 per cent.

Declining issues outnumbered advancing ones on the NYSE by a 1.33-to-1 ratio; on Nasdaq, a 1.30-to-1 ratio favored decliners.

The S&P 500 posted 56 new 52-week highs and one new low; the Nasdaq Composite recorded 153 new highs and 24 new lows.

About 6.9 billion shares changed hands on U.S. exchanges, just above the daily average of 6.8 billion over the last 20 sessions.