NEW YORK (Reuters) - Major U.S. stock indexes closed higher and Canadian and Mexican currencies gained briefly on Thursday after U.S. President Donald Trump set tariffs on steel and aluminum imports but exempted Canada and Mexico.

FILE PHOTO: A bank employee holds a pile of 500 euro notes at a bank branch in Madrid January 13, 2011. REUTERS/Andrea Comas/File Photo

Trump had earlier pledged to slap tariffs on all countries, and strategists said Thursday’s plan was milder than many investors expected.

Other countries can apply for exemptions, according to the Trump administration, although details of when they would be granted were thin.

“He dialed it back a little bit,” said Michael O’Rourke, chief market strategist at JonesTrading in Greenwich, Connecticut. “But we’re still going in the wrong direction from a policy perspective if you’re a markets-focused globalist.”

Trump is imposing 25 percent tariffs on steel imports and 10 percent for aluminum.

Investors have been on edge since last week when Trump proposed the tariffs, sparking worries that the move would trigger a global trade war.

The Canadian dollar and Mexican peso briefly gained against the dollar following Thursday announcement.

“Probably a sigh of relief to the extent that it is not going to get slapped on Canada straight away,” said Shaun Osborne, chief currency strategist at Scotiabank.

Canada is the largest supplier of both steel and aluminum to the United States

Slideshow ( 2 images )

The Mexican peso gained 0.09 percent versus the U.S. dollar at 18.64. The Canadian dollar rose 0.05 percent versus the greenback at 1.29 per dollar.

The euro was up 0.02 percent to $1.2313, while the dollar index rose 0.53 percent.

Earlier, euro dropped as the European Central Bank signaled caution on inflation and protectionism.

While the ECB took a small step toward weaning the euro-zone economy off protracted stimulus by dropping its easing bias, ECB President Mario Draghi said monetary policy would remain “reactive” and that underlying inflation was subdued.

Draghi also addressed the U.S. tariff plans, saying, “If you put tariffs against (those) who are your allies, one wonders who the enemies are.”

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

The U.S. healthcare sector was rattled as health insurer Cigna Corp said it would buy pharmacy benefits manager Express Scripts Holding Co for about $54 billion. Express Scripts shares jumped 8.6 percent while Cigna dropped 11.5 percent.

MSCI’s gauge of stocks across the globe gained 0.45 percent, and the pan-European FTSEurofirst 300 index rose 1.02 percent.

Benchmark U.S. 10-year notes last rose 7/32 in price to yield 2.8571 percent, from 2.883 percent late on Wednesday.

Oil prices fell and were setting up for a second consecutive weekly drop as the dollar strengthened and concerns over rising U.S. crude production continued to mount on signs of an inventory build at a key U.S. storage hub.

Brent crude futures fell 73 cents, or 1.1 percent, to settle at $63.61 per barrel. U.S. crude futures fell $1.03, or 1.7 percent, to settle at $60.12 per barrel.

Spot gold was down 0.4 percent at $1,320.67 per ounce.