The three major U.S. stock indexes closed higher on Thursday after President Donald Trump appeared to soften his stance on trade tariffs, easing trade war fears that had had the market on edge for a week.

Trump announced import tariffs on steel and aluminum but said Canada and Mexico would be exempt and that other countries could apply for exemptions, although details of when they would be granted were thin.

“This is something that bites less than what the rhetoric was last week," said Chuck Carlson, Chief Executive Officer at Horizon Investment Services in Hammond, Indiana.

"It’s a softer play on the idea than the original 'sky was falling' reaction last week when it sounded like it was going to be across the board, no ifs, ands or buts, and everybody was just going to get hammered,” he said.

The Dow Jones Industrial Average rose 93.85 points, or 0.38 per cent, to close at 24,895.21, the S&P 500 gained 12.17 points, or 0.45 per cent, to 2,738.97 and the Nasdaq Composite added 31.30 points, or 0.42 per cent, to 7,427.95.

Ahead of the news that trickled out from the White House in the last hour and a half of the trading day, the S&P had zig-zagged in a tight range between positive and negative territory as investors were uncertain about what Trump would say.

Worries that the tariffs would ignite a global trade war have dominated markets since he announced the tariff plan last Thursday, and the exit of chief economic adviser Gary Cohn late Tuesday intensified the concerns.

But not everybody was pleased with the latest trade news.

Century Aluminum (CENX.O) shares fell 7.5 per cent after the news as it had been seen benefiting from higher prices if the tariffs were put in place. Shares in U.S. Steel Corp (X.N) fell 2.9 per cent while AK Steel (AKS.N) closed down 4 per cent.

Michael O’Rourke, Chief Market Strategist at JonesTrading in Greenwich, Connecticut was still concerned about how Trump's policies could affect global trade.

"He dialed it back a little bit, but they're still tariffs, and we're still going in the wrong direction from a policy perspective if you're a markets-focused globalist. I wouldn't be surprised if he comes out with different tariffs on other things," he said.

The energy index was the only one of the S&P's 11 sectors to end the day lower, with a 0.1 per cent drop as oil prices declined.

Advancing issues outnumbered declining ones on the NYSE by a 1.38-to-1 ratio; on Nasdaq, a 1.15-to-1 ratio favored advancers.

The S&P 500 posted 26 new 52-week highs and one new low; the Nasdaq Composite recorded 157 new highs and 22 new lows.

Volume on U.S. exchanges was 6.38 billion shares, compared to the 7.65 billion average for the last 20 trading days.

CANADIAN STOCKS

Canada's main stock index closed higher on Thursday, with all sectors but one in positive territory, after Trump’s temporary exemption.

The Toronto Stock Exchange's S&P/TSX composite index ended the day up 66.09 points, or 0.43 per cent, at 15,538.70.

Shares of trade-sensitive railroad  and auto parts companies recovered. Canadian National Railway Co (CNR.TO) jumped 1.05 per cent to $95.08 and Martinrea International (MRE.TO) climbed 4.1 per cent to $15.22.

Packing tape-maker Intertape Polymar Group (ITP.TO) and machine manufacturer Linamar Corp were the biggest gainers on the index, rising 8.5 per cent and 8.4 per cent respectively, after reporting fourth-quarter profits that beat expectations.

The technology group was the sector with the most gains, rising 1.2 per cent.

Paramount Resources (POU.TO) was the biggest decliner on the index, losing 5.5 per cent, after posting a fourth-quarter loss that was bigger than expected.

Other mining companies Ivanhoe Mines (IVN.TO), Teck Resources (TECKb.TO) and Franco-Nevada Corp (FNV.TO) were also among the biggest decliners, hit by a retreat in metal and oil prices.

Copper futures pulled back 1.8 per cent to US$6,823 a tonne, while gold futures slipped 0.4 per cent to US$1,322.7 an ounce. U.S. oil futures fell 1.4 per cent to US$60.31 a barrel.

The TSX materials group, which includes precious and base metals miners and fertilizer companies, lost 0.5 per cent. The energy group was the next-worst performer, with a 0.16 per cent gain.

Cominar REIT (CUF_u.TO) was the third-biggest decliner on the index, falling 5.2 per cent after reporting a drop in its quarterly operating revenue.

Marijuana producer Canopy Growth (WEED.TO) was the most actively traded stock on the index.

There were 164 advancing issues and 78 declining ones. Eight were flat.

At 4 p.m. ET, the Canadian dollar was trading 0.1 per cent higher at 77.53 U.S. cents.