A resilient market brushed aside earlier losses to end the day higher. Stocks had started off the session with sharp losses after North Korea launched its latest missile test, the first to fly over Japan in around eight years. United Technologies Corp. (UTX) was the best performer on the Dow Jones Industrial Average, helping to lift the blue-chip index out of the red. The defense stock spiked following a Wall Street Journal report that it is close to purchasing Rockwell Collins Inc. (COL) in a deal worth more than $20 billion. Nike Inc. (NKE) bottomed out the Dow after Morgan Stanley downgraded its rating on slowing sales in North America. The firm also cut the company's 2018 earnings and sales target. Energy shares were active as the effects of Harvey's flooding on refinery operations continued to be assessed. Major oilers such as Anadarko Petroleum Corp. (APC) and Marathon Petroleum Corp. (MPC) were lower.

More from Video

Here's One Reason Why the Markets Have Become Resilient to Trade Worries

Here's One Reason Why the Markets Have Become Resilient to Trade Worries

Jim Cramer: Walmart, Nike and FedEx Point to a Strong US Economy

Jim Cramer: Walmart, Nike and FedEx Point to a Strong US Economy

Jim Cramer: The US Has Leverage Over China

Jim Cramer: The US Has Leverage Over China

Jim Cramer Talks China, Walmart, Nike, FedEx and More

Jim Cramer Talks China, Walmart, Nike, FedEx and More

Wall Street Is Probably Too Optimistic on Stocks, Sell Now

Wall Street Is Probably Too Optimistic on Stocks, Sell Now