The S&P 500 and Nasdaq Composite rose on Thursday as Apple became the first U.S. publicly traded company in history to reach $1 trillion in market value.
The advanced 0.5 percent to 2,827.22, while the tech-heavy Nasdaq jumped 1.2 percent to 7,802.69. The Dow Jones Industrial Average closed just 7.66 points lower at 25,326.16, nearly erasing a 200-point loss.
Apple shares rose 2.9 percent to $207.39 a share, lifting its market cap above the $1 trillion mark. Apple's stock has been on a tear since the company reported stronger-than-forecast quarterly results on Tuesday. Since then, the stock is up nearly 9 percent.
"It's good for confidence in the market to the extent that it's a widely owned stock," said Marc Chaikin, CEO of Chaikin Analytics. "A lot of market-cap weighted ETFs are getting a boost from this."
The major indexes fell earlier in the session as trade worries intensified after the Trump administration threatened to slap bigger tariffs on China.
The U.S. administration announced on Wednesday that President Donald Trump asked U.S. Trade Representative Robert Lighthizer to consider increasing the proposed levies on $200 billion worth of Chinese goods up to 25 percent, from 10 percent.
China's Ministry of Commerce responded to the U.S. announcement saying: "China is fully prepared and will have to retaliate to defend the nation's dignity and the interests of the people, defend free trade and the multilateral system, and defend the common interests of all countries."
Shares of big exporters Caterpillar and Boeing fell 0.4 percent and 0.9 percent, respectively.
Global stock markets fell. The Shanghai Composite and Nikkei 225 dropped 2 percent and 1.03 percent, respectively. In Europe, the Stoxx 600 index fell 0.8 percent.
"Investors are flirting with a combination of bad news," said Peter Cardillo, chief market economist at Spartan Capital Securities. "President Trump doesn't appear to be backing down and the Chinese have threatened to retaliate."
Earnings season continued on Thursday with DowDuPont and Aetna reporting better-than-expected quarterly results. Aetna's shares rose 0.1 percent, but DowDuPont's stock fell more than 2 percent.
Tesla shares surged more than 16 percent after CEO Elon Musk said the company would be profitable in the second half. However, Tesla posted a wider-than-expected loss on the bottom line for the previous quarter.
More than 70 percent of S&P 500 companies have reported quarterly results through Thursday morning, with 78 percent reporting better-than-expected profits, FactSet data shows.
"Generally earnings themselves have been robust, but appear to have been fully discounted in most cases by the market," said Michael Shaoul, chairman and CEO of Marketfield Asset Management. "In a few high profile cases earnings disappointed, triggering very sharp losses in equity prices, again reflecting high levels of positioning."
The Labor Department said weekly jobless claims rose to 218,000. Economists polled by Reuters expected an increase to 220,000. The report comes after the Federal Reserve kept interest rates unchanged, but upgraded its outlook on the U.S. economy to strong. It also comes ahead of the Labor Department's monthly jobs reports, scheduled for release Friday.