NEW YORK (Reuters) - A key gauge of world stock markets slipped on Wednesday but ended far above session lows, as fears that U.S. President Donald Trump will proceed with protectionist tariffs and risk a global trade war were tempered by signs the move could include carve-outs for key partners.

Stocks and the U.S. dollar recovered most of the day’s losses after the White House said proposed steel and aluminum tariffs could exclude Mexico, Canada and possibly other countries.

Trading was volatile through the session as some investors wagered that even with the departure of Trump’s chief economic adviser Gary Cohn, until now a key ally of free markets inside the White House, the president’s hard talk on trade could be a tactic amid ongoing agreement negotiations.

White House spokeswoman Sarah Sanders told a media briefing “there are potential carve-outs for Mexico and Canada based on national security, and possibly other countries as well.”

A ceremony for Trump to sign a document to set steel and aluminum tariffs is planned for Thursday afternoon, a source told Reuters.

The Mexican peso and Canadian dollar recovered from steep losses, with the peso turning higher against the greenback after Sanders’ comments.

Against the greenback, the Mexican peso gained 0.15 percent to 18.71. The Canadian dollar was down 0.21 percent to 1.29 per U.S. dollar.

“It makes investors less worried if the tariff isn’t applied so broadly,” said Janna Sampson, co-chief investment officer at OakBrook Investments LLC in Lisle, Illinois.

“But it’s speculation at this point. We have nothing in writing. If there’s one thing we’ve learned from this administration it’s that it could change by the time it’s in writing.”

Traders work on the floor of the New York Stock Exchange, (NYSE) in New York, U.S., March 7, 2018. REUTERS/Brendan McDermid

The overall outlook for the U.S. currency was downbeat, despite the mixed sentiment over trade policy. Goldman Sachs economists wrote that tariffs similar to those proposed by Trump have usually been associated with subsequent currency weakness.

“We therefore see the latest news as an additional reason to remain cautious on the outlook for the broad dollar,” Goldman economists Zach Pandl and Karen Reichgott wrote.

The dollar index, which tracks the greenback against a basket of other major currencies, fell 0.04 percent, with the euro up 0.09 percent to $1.2413.

The Japanese yen strengthened 0.02 percent versus the greenback at 106.10 per dollar, while sterling was last trading at $1.3905, up 0.14 percent on the day.

STOCKS DIP, OIL DROPS

Losses on the S&P 500 were as deep as 1 percent at one point, but ebbed and flowed as traders sought clues on the future of trade policy in the day’s headlines. U.S. indexes rose sharply after Sanders’ comments.

Equities also got a bid earlier after White House trade adviser Peter Navarro, who favors strong tariffs, said in a Bloomberg interview he was not a candidate to replace Cohn.

“The market sees him (Navarro) as a very protectionist type. If he’s not in the running, the market seems to like that,” said Joe Saluzzi, co-manager of trading at Themis Trading in Chatham, New Jersey.

Jason Ware, chief investment officer at Albion Financial in Utah, said that with Trump keeping a close eye on stock indexes, selling sparked by tariff and trade war talks could change the president’s mind.

“Indeed, here is a president who judges his success by using the stock market as an important barometer for that. So if the market votes an overwhelming vote of no confidence on these tariffs, is there a chance that things change next week?”

“I suspect that it’s still a fluid situation,” Ware said.

The Dow Jones Industrial Average fell 82.76 points, or 0.33 percent, to 24,801.36, the S&P 500 lost 1.32 points, or 0.05 percent, to 2,726.8 and the Nasdaq Composite added 24.64 points, or 0.33 percent, to 7,396.65.

European car makers ended up 0.6 percent after dropping more than 1 percent on the risk of a hike in tariffs on exports to the United States.

MSCI’s gauge of stocks across the globe shed 0.12 percent, while the pan-European FTSEurofirst 300 index earlier closed up 0.35 percent.

Emerging market stocks lost 0.40 percent. MSCI’s broadest index of Asia-Pacific shares outside Japan closed 0.58 percent lower, while Japan’s Nikkei percent.

Oil prices fell after U.S. government data showed an increase in inventories, with Washington’s plans for import tariffs weighing further on investor sentiment.

U.S. crude fell 2.01 percent to $61.34 per barrel and Brent was last at $64.51, down 1.95 percent.

Benchmark 10-year U.S. Treasury notes last fell 2/32 in price to yield 2.8827 percent, from 2.877 percent late on Tuesday.

The 30-year bond last fell 9/32 in price to yield 3.1506 percent, from 3.136 percent late on Tuesday.

Spot gold percent to $1,325.29 an ounce. U.S. gold futures fell 0.67 percent to $1,326.20.

Copper lost 0.90 percent to $6,941.00 a tonne.