Stocks rose on Thursday after comments from a top Federal Reserve official led to increasing bets that the central bank will ease monetary policy more aggressively.
The S&P 500 closed 0.4% higher at 2,995.11, led by a 0.8% gain in consumer staples. The Nasdaq Composite advanced 0.3% to 8,207.24. The Dow Jones Industrial Average ended the day up just 3.12 points, or 0.01%, at 27,222.97, after dropping as much as 151.06 points. The gains were the first for the indexes in three sessions.
The indexes turned around in the afternoon came after New York Federal Reserve President John Williams said the central bank needed to "act quickly" when the economy was slowing and rates were low. "It's better to take preventative measures than to wait for disaster to unfold," he said in a speech.
After Williams' comments, traders increased their bets that the Fed could go deeper than a quarter-point cut at its meeting in late July.
The market's gains, however, were kept in check as Wall Street digested a mixed batch of corporate earnings results.
Netflix shares plunged more than 10% after the streaming giant reported a surprise loss in U.S. subscribers coupled with slower-than-expected international membership growth. Those metrics — which are key for Netflix — offset a better-than-expected earnings per share result for the previous quarter.
"You had some price increases and a weaker slate but still, in general, it doesn't have anything to say about the consumer or the health of the economy. I think you might be getting an opportunity there, although you might have to be patient," said Tom Martin, senior portfolio manager at Globalt.
IBM shares, meanwhile, briefly fell at the open before recovering after the company reported its fourth consecutive revenue decline. Declining sales from IBM's IT division offset growth in its cloud business.
Morgan Stanley posted better-than-expected quarterly results, driven by its wealth management and fund divisions. The stock rose 1.5%.
"We're going to see companies beat on earnings," said Kate Warne, investment strategist at Edward Jones. "This will be a positive catalyst but not a very positive one."
But Warne said she is still optimistic on U.S. stocks as the Federal Reserve is likely to lower interest rates. "The support for the market is better now than it was last year."
So far, more than 12% of S&P 500 companies have reported quarterly results this earnings season. Of those companies, nearly 84% have reported better-than-expected earnings, according to FactSet data.
"When you look at it, it seems like a mixed bag and the consumer is shoring up what's happening here in the market in terms of earnings," said Dave Campbell, a principal at BOS. "One of the things you're seeing is those companies that are supported by the consumer are doing fairly well. That's because the consumer is still spending right now."
"Where you're seeing pullbacks or earnings declines tends to be in areas or industries where companies may be in vulnerable positions," he said. Because of the trade uncertainty, "farmers are getting hit, but it's also companies that are getting hit. They've gotten some of their markets cut off from them and some of them are impacted by tariffs."
The major indexes reached all-time highs earlier this week but worries over the ongoing earnings season and lingering concern over U.S.-China tensions have knocked them from those levels.
Stocks closed lower for a second day in a row on Wednesday after The Wall Street Journal reported that trade negotiations between the U.S. and China had faltered over restrictions on Chinese telecommunications giant Huawei, citing sources familiar with the talks.
However, Treasury Secretary Steven Mnuchin told CNBC that Huawei was not a sticking point in the negotiations, adding a call between U.S. and China trade officials was scheduled for later on Thursday.
—CNBC's Elliot Smith contributed to this report.
Correction: A previous version of this story misstated Dave Campbell's name.