While the Nasdaq climbed 39.68 points or 0.6% to 6,256.56, the Dow inched up 14.31 points or 0.1% to 21,858.32 and the S&P 500 edged up 3.11 points or 0.1% to 2,441.32. The S&P 500 gained 3.11 points, or 0.1%, to end at 2,441.32, supported by gains in consumer-discretionary, technology and health-care sectors. On the Nasdaq, 1 378 issues rose and 892 fell.
The escalation provided an excuse for a selloff many investors consider overdue, some investors and analysts said.
The data comes amid tepid inflation that has remained below the Fed's 2% target, despite low unemployment. Is that a reason to be?
"While not necessary unexpected - as the United States had to respond to threats made by North Korea that they will fire rockets due to land just off the coast of Guam soon - new comments by Trump propelled stocks lower". They suggest the USA and China, a North Korean ally, could work together to de-escalate the situation. The index had its biggest drop since mid-May a day earlier.
But for the week the S&P 500 lost 1.3 percent, its worst weekly showing since March.
"If you strip away what's going on in North Korea, and if you strip away what's going on in Washington, which are things that are tougher to predict, the economy, the global recovery, earnings, it all paints a very positive picture for the rest of the year", Kravetz said.
Japanese markets were closed for a holiday but the yen powered on, hitting an eight-week high of 108.91 yen to the dollar, adding to its biggest weekly gain since May.
The yield on the benchmark 10-year Treasury note settled at 2.191%, its lowest close since June 26, compared with 2.211% Thursday and 2.269% last Friday.More news: Wenger 'relieved' Giroud has made a decision to stay
More news: Lai Mohammed, Femi Adesina and others visit Buhari in London
More news: How major USA stock market indexes fared Thursday
"If the data continues to come in on the softer side, the market might start to price the Fed staying on hold this year", said Sireen Harajli, FX strategist at Mizuho in NY.
Following the sell-off seen in the previous session, stocks may regain some ground in early trading on Friday. MSCI's broadest index of Asia-Pacific shares outside Japan closed 1.47 percent lower.
Nvidia Corp.(NVDA) shares fell 5.3%, even after the chip maker posted upbeat earnings late Thursday.
The pan-European Stoxx 600 ended over 1% lower to a five-month low with nearly all sectors in negative territory.
An editorial in China's state-run Global Times (http://www.globaltimes.cn/content/1060791.shtml), published late Thursday local time, added to the pressure on Asian markets.
"For quite some time the market hasn't really reacted to things on the Korean peninsula because we know from the past it is largely North Korean sabre-rattling, and it may yet be".
The tentative gains "suggest that the headline shock value pertaining to the US-North Korea standoff is starting to dissipate, which is to say actual action will now speak much louder than words", said Briefing.com analyst Patrick O'Hare.
J.C. Penney sank 16.6 percent after the struggling department store chain reported quarterly results that fell short of Wall Street's expectations. UBS said in a note it had increased its long position in gold as forward real interest rates declined and commodity prices increased, while it also added to longs in the platinum group metals as investment demand rose.