US stocks recovered at the close from steep early losses brought by fears of escalation of hostilities in the Korean Peninsula.
US President Donald Trump had warned that "all options are on the table" after North Korea fired a missile over Japan.
The Dow Jones, a basket of 30 major US companies, rose 0.27% to 21,866.23, while the wider S&P 500 index was up 0.08% to 2,446.30.
The Nasdaq added 0.30% at 6,301.89.
The S&P 500 fell as much as 0.66% after Mr Trump's warning to North Korea.
"When the President says 'All options are on the table,' the best strategy for investors is sometimes to do nothing," said Brian Jacobsen, senior investment strategist at Wells Fargo Funds Management in Menomonee Falls, Wisconsin.
Meanwhile, Storm Harvey closed refineries across Texas, but stocks in the energy sector were little changed, with declines in oil services companies mostly offset by gains in refiners and some producers.