Global stocks swooned Tuesday after North Korea fired a missile into Japanese air space, deepening geopolitical worries while sending safe-haven assets like gold higher.
But Wall Street righted itself mid-session, with two of its major indices shrugging off missile-related worries and grinding out a positive result for the day.
Hurricane Harvey's impact on Texas and the oil industry also weighed on investor sentiment, pushing oil stocks lower.
Although investors were shaken overnight after North Korea launched a missile that passed over Japan, "The market was relieved in large part to find out that our response was measured, as opposed to two weeks ago," said Art Hogan of Wunderlich Securities.
President Donald Trump had earlier promised "fire and fury" if the North persisted in provocations with is nuclear weapons program but on Tuesday made no explicit mention of retaliation, saying only that "all options" were on the table.
The blue-chip Dow Jones Industrial Average and tech-heavy Nasdaq both finished up 0.3 percent. But the broader S&P 500, which comprises many companies based in Houston, Texas, which bore the brunt of Harvey, was flat.
Gold, a safe-haven asset, gave up some early gains but rose 0.3 percent from Monday's close to $1,314 per troy ounce. The yen surged to four-month peak against the dollar, while the euro topped $1.20 for the first time since January 2015.
Earlier in the day, London, Frankfurt and Paris all lost between 0.9 percent and 1.5 percent, with investors still unnerved by North Korea's continuing brinkmanship.
Hong Kong and Tokyo stocks also crumbled as investors dumped risky equities.
"Risk-sensitive stocks have fallen sharply while perceived safe-haven gold, Japanese yen and Swiss franc have soared higher," said Fawad Razaqzada of Forex.com.
NFS Macro analyst Nick Stamenkovic told AFP, "Rising geopolitical tensions have prompted a flight to quality, benefiting safe-haven assets at the expense of risk markets."
At the same time, the greenback has been hampered by ongoing uncertainty over Trump's tax-cutting plans, as well as North Korea developments.
- Key figures around 2100 GMT -
New York - Dow: UP 0.3 percent at 21,865.37 points (close)
New York - S&P 500: FLAT at 2,446.30 (close)
New York - Nasdaq: UP 0.3 percent at 6,301.89 (close)
London - FTSE 100: DOWN 0.9 percent at 7,337.43 (close)
Frankfurt - DAX 30: DOWN 1.5 percent at 11,945 (close)
Paris - CAC 40: DOWN 0.9 percent at 5,031.92 (close)
EURO STOXX 50: DOWN 1.0 percent at 3,388.22 (close)
Tokyo - Nikkei 225: DOWN 0.5 percent at 19,362.55 (close)
Hong Kong - Hang Seng: DOWN 0.4 percent at 27,765.01 (close)
Shanghai - Composite: UP 0.1 percent at 3,365.23 (close)
Euro/dollar: DOWN to $1.1974 from $1.2030
Pound/dollar: DOWN to $1.2919 from $1.2947
Dollar/yen: UP to 109.75 yen from 108.59 yen
Oil - Brent North Sea: UP 11 cents at $52.00 per barrel
Oil - West Texas Intermediate: DOWN 13 cents at $46.44