The United States said it will impose preliminary anti-subsidy duties averaging 20 percent on imports of Canadian softwood lumber, escalating a long-running trade dispute between the two neighbors.

RBC analysts said the rates set were at the low end of their 20 percent to 30 percent expectation, while top Canadian officials said the country will fight back against the tariffs and win again.

Shares of West Fraser Timber Co Ltd (>> West Fraser Timber Co. Ltd.), which would pay the highest duty rate of the affected companies, rose 8.8 percent to 61.30, helped also by the release of better-than-expected earnings after the close on Monday. Canfor Corp (>> Canfor Corporation) stock gained 7.9 percent to C$19.61.

Gains for the Toronto Stock Exchange's S&P/TSX composite index <.GSPTSE> came as improved risk appetite after the first round of the French presidential election helped push global stocks higher.

"People saw what they were hoping to see at the weekend and as a result the risk-on trade is back on in a big way," said Ian Scott, equity analyst at Manulife Asset Management.

Strong corporate earnings and anticipated announcement on Wednesday of the Trump administration's tax overhaul added to support for the market, Scott said.

The energy group climbed 1.5 percent, as oil broke its recent losing streak, with Canadian Natural Resources (>> Canadian Natural Resources Limited) advancing 2.4 percent to C$45.33.

U.S. crude oil futures settled 33 cents higher at $49.56 a barrel.

The financials group gained 0.6 percent, led by a 1.0 percent gain for the country's largest bank, Royal Bank of Canada, to C$97.03.

Shares of Metro Inc (>> Metro, Inc.) climbed 6.9 to C$45.18 after the retailer met earnings expectations and upped its dividend.

The TSX closed up 32.73 points, or 0.21 percent, at 15,745.19.

Seven of the index's 10 main groups ended higher, with the materials sector down 2.5 percent as disappointing earnings from two major miners offset the lumber company gains.

Barrick Gold Corp (>> Barrick Gold Corp), the world's largest gold miner, fell nearly 11.0 percent to C$22.89, after reporting weaker-than-expected earnings and as gold prices fell to a two-week low.

Teck Resources Ltd (>> Teck Resources Ltd) fell 2.5 percent to C$28.84 after North America's largest producer of steelmaking coal reported lower-than-expected profit due to higher costs, lower production and sales volumes.

(Additional reporting by Alastair Sharp; Editing by David Gregorio and Bill Trott)

By Fergal Smith