The Dow Jones industrial average erased a nearly 400-point loss Thursday afternoon as tailwinds from strong earnings helped the index snap a four-day losing streak.
The Dow Jones industrial average edged out a 5.17-point gain to finish at 23,930.15 by the closing bell after falling nearly 400 points in morning trading. The S&P 500 closed down 0.23 percent to close at 2,629.73 after dropping as much as 1.6 percent. Both indexes also dipped below their 200-day moving averages, but were back above those levels by the end of the session.
The Nasdaq composite fell 0.18 percent after dropping more than 1 percent, ending the day at 7,088.15. The Nasdaq pared losses later in the day was buoyed by a rebound in Amazon and Apple shares as well as a 0.6 percent gain in software giant Microsoft. Enterprise technology company Cisco added 1.3 percent.
"The market got very cheap and buyers just came in," said Jeremy Klein, chief market strategist at FBN Securities. "I mean you'll still seeing sectors like banks lag ... [but] industrials had a really nice bounce. A stock like Boeing, which has been really dragging lately, found a nice bid this morning."
Boeing — which has struggled for gains since reporting earnings last week — carried the Dow higher, with the aircraft manufacturer rallying 2 percent. Shares of fellow industrial company 3M gained 0.6 percent.
The afternoon rally came after a sharp fall in equities earlier in the session, as a batch of better-than-expected earnings failed to push the major averages higher while trade and geopolitical worries mounted.
Tesla reported better-than-forecast quarterly results Wednesday after the close. However, the stock fell 5.5 percent after CEO Elon Musk dismissed questions from analysts regarding gross margins and Model 3 production.
Meanwhile, Church & Dwight, Blue Apron and Express Scripts also posted results that beat the Street's forecasts.
Treasury Secretary Steven Mnuchin is leading a group of Trump administration officials to meet with Chinese Vice Premier Liu He and discuss trade between the two nations.
Shortly before the talks were set to take place in Beijing, the mood between the world's two largest economies worsened amid reports the U.S. administration is considering taking executive action to restrict some Chinese firms' ability to sell telecoms equipment.
On Wednesday night, President Donald Trump said in a tweet the group of administration officials "is in China trying to negotiate a level playing field on trade! I look forward to being with President Xi in the not too distant future."
"Trump's 'level playing field' implies a harder line and general sentiment around the talks is going to be volatile," said Tom Essaye, founder of The Sevens Report. "Chances of a grand bargain are virtually nil but the market does want a de-escalation of trade tensions."
Meanwhile, Iran Foreign Affairs Minister Mohammad Javad Zarif said the country will not renegotiate the nuclear deal it struck with the U.S. in 2015. Zarif said in a YouTube video: "Iran will not renegotiate what was agreed years ago and has been implemented ... also we will reject any ratification of it."
Gold futures jumped 0.5 percent to settle at $1,312.70 per ounce. The precious metal is often seen as a safe-haven trade.
Wall Street also eyed Washington amid more news regarding Trump's legal troubles. In an interview with Fox News, Rudy Giuliani, one of the lawyers representing the president in the special counsel's probe, said Trump repaid his personal lawyer Michael Cohen for a hush payment to porn star Stormy Daniels.
His statements appear to contradict the version of events told by both Trump and Cohen about the payment.
"We're facing a dual headwind of trade wars and noise" around the Mueller investigation, said Art Hogan, chief market strategist at B. Riley FBR. He noted the market had recently been ignoring news about Trump's legal troubles as corporate earnings results flooded the news cycle.