NEW YORK (Reuters) - 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 .DJI rose 93.85 points, or 0.38 percent, to close at 24,895.21, the S&P 500 .SPX gained 12.17 points, or 0.45 percent, to 2,738.97 and the Nasdaq Composite .IXIC added 31.30 points, or 0.42 percent, 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 percent 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 percent while AK Steel AKS.N closed down 4 percent.

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 .SPNY was the only one of the S&P's 11 sectors to end the day lower, with a 0.1 percent drop as oil prices declined. [O/R]

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.