The Toronto Stock Exchange's S&P/TSX composite index ended up 181.35 points, or 0.9%, at 20,618.47, its highest closing level since Sept. 15.

"It is mostly to do with the higher inflationary number coming out of the U.S.," said Allan Small, senior investment advisor of the Allan Small Financial Group with iA Private Wealth.

"That has sparked a pretty bid drive right up in gold, materials ... that's what's driving the bus."

U.S. consumer prices increased solidly in September as Americans paid more for food, rent and a range of other goods, putting pressure on the Biden administration to urgently resolve strained supply chains, which are hampering economic growth.

Gold is seen as a hedge against inflation. It rose nearly 2%, helped also by a pullback in U.S. Treasury yields, while copper futures advanced 3.8%.

Both the materials group, which includes precious and base metals miners and fertilizer companies, and the technology sector added 2.2%, while industrials ended up 1.3%.

Energy gave back some recent gains, falling 0.6%, as the rally in crude oil lost some momentum. U.S. crude oil futures settled 0.3% lower at $80.44 a barrel.

Among the largest percentage gainers on the TSX were Eldorado Gold Corp, which rose 9.3%, and Blackberry Ltd, which ended 4.7% higher.

(Reporting by Fergal Smith; Additional reporting by Amal S in Bengaluru; Editing by Cynthia Osterman)

By Fergal Smith