Oil was steady, gold rebounded and several industrial metals also benefited from a "risk-on" attitude in financial markets that swept global shares and bond yields higher.

"You're seeing some of the big risk factors dissipate, crude oil come back, the Chinese markets stabilize," said Elvis Picardo, strategist at Global Securities in Vancouver.

"It helps the TSX because it's so leveraged to global growth expectations," he said.

The Toronto Stock Exchange's S&P/TSX composite index <.GSPTSE> ended up 35.83 points, or 0.28 percent, at 13,017.93. It was last above 13,000 on the last day of 2015.

Energy stocks gained 2.1 percent and the materials sector, which includes precious and base metals miners and fertilizer companies, surged 3.4 percent, while six of the index's 10 main groups fell.

Picardo said the index is approaching fair value as it tries to break above its 100-day moving average around 13,000.

"Does it pull back? Does it go further up from here? It's one of those inflection points that's a little hard to call," he said, suggesting further gains in oil and other commodity prices would be needed to keep resource stocks rising.

Canadian Natural Resources Ltd (>> Canadian Natural Resources Limited), one of the country's largest energy companies, jumped 4.8 percent to C$30.17.

Shares of Potash Corp (>> Potash Corporation of Saskatchewan Inc) rose 5.7 percent to C$24.49, while First Quantum Minerals (>> First Quantum Minerals Limited) surged 27.6 percent to C$6.62 and Teck Resources Ltd (>> Teck Resources Ltd) jumped 19.5 percent to C$9.51. Barrick Gold Corp (>> Barrick Gold Corp.) gained 2.3 percent to C$18.23.

The most influential weights on the index included Canadian National Railway (>> Canadian National Railway Company), down 1.9 percent at C$77.65, and Brookfield Asset Management (>> Brookfield Asset Management Inc), which slipped 2.7 percent to C$41.98.

The financials group fell 0.4 percent, while industrials lost 0.7 percent.

Consumer staple stocks also dragged. Loblaw Companies Ltd (>> Loblaw Companies Limited) fell 1 percent to C$69.45, while Metro Inc (>> Metro, Inc.) was down 1.4 percent at C$43.04.

Label and packaging maker CCL Industries Inc (>> CCL Industries Inc.) rose 11.8 percent to C$234.17 following news it is buying U.S.-based Checkpoint Systems Inc (>> Checkpoint Systems, Inc.) for about $422 million.

(Additional reporting by Fergal Smith; Editing by Paul Simao and James Dalgleish)

By Alastair Sharp