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

Video: Here Is Why Carvana Isn't Worried About Amazon

Video: Here Is Why Carvana Isn't Worried About Amazon

Video: What Oprah's Content Partnership With Apple Means for the Rest of Tech

Video: What Oprah's Content Partnership With Apple Means for the Rest of Tech

REPLAY: Jim Cramer on the Markets, Oil, Starbucks, Tesla, Okta and Red Hat

REPLAY: Jim Cramer on the Markets, Oil, Starbucks, Tesla, Okta and Red Hat

Flashback Friday: The Market Movers

Flashback Friday: The Market Movers

This Could Be the Summer of Hard Seltzer

This Could Be the Summer of Hard Seltzer