By Michael Wursthorn and Avantika Chilkoti
The S&P 500 recouped an early loss to clinch its fifth straight session of gains after Federal Reserve Chairman Jerome Powell reiterated the central bank's willingness to adjust its pace of interest-rate increases if economic conditions weaken.
Speaking at the Economic Club in Washington, Mr. Powell said the economy is on solid footing and there are few signs a recession is imminent, but the Federal Reserve isn't committed to a set course of rate increases, echoing a more market-friendly tone the central bank has taken since a punishing fourth-quarter selloff nearly upended the long-running bull market.
The Fed is open to quickly altering its pace, especially with inflation remaining subdued, he said. "We are in a place where we can be patient and flexible and see what does evolve," added Mr. Powell.
The comments helped ease the fears of some investors who earlier Thursday had been parsing a series of lackluster holiday sales reports from retailers, along with weak economic data out of Asia and Europe, for additional signs of fading global growth.
Mr. Powell's comments also added to investors' optimism that the Fed is looking to avoid a misstep with interest rates if the economy shows any signs of stumbling, a dovish message the central bank has amplified through speeches, question-and-answer sessions and meeting minutes in recent weeks.
The S&P 500 added 11.68 points, or 0.5%, to 2596.64 after falling nearly 1% earlier in the session. While stocks had been moderating their losses as the day wore on, the S&P 500 got a nudge following Mr. Powell's speech, helping the index notch its longest winning streak since September.
The Dow Jones Industrial Average added 122.80 points, or 0.5%, to 24001.92. The Nasdaq Composite added 28.99, or 0.4%, to 6986.07
Shares of industrial companies helped pull the S&P 500 higher, with aerospace giant Boeing among the sector's biggest gainers. Boeing's stock rose $8.78, or 2.6%, to $352.61 after an analyst raised his rating on the company, citing optimism around the commercial aerospace industry.
Investors also gravitated toward less risky corners of the stock market that pay rich dividends, including shares of utilities and real-estate companies, sending those sectors up 1.4% and 1.5%, respectively.
That helped offset deep losses among retail stocks. Shares of Macy's fell 5.61, or 18%, to 26.11, the stock's biggest single-day percentage decline ever, after the retailer lowered its guidance and reported weak December sales.
Kohl's and Victoria's Secret owner L Brands both fell more than 4% after posting tepid holiday sales.
The losses reverberated throughout the retail sector, pulling shares of other companies down, including those that had posted better results over the past couple of months. Target, for example, fell 2, or 2.85%, to 68.29 despite reporting a bump in sales over the past two months.
"Retail is where average consumers get a feel about spending," said Diane Jaffee, a senior portfolio manager at TCW Group. "The Macy's news was disconcerting for investors. We haven't seen a real hammering of the consumer yet, but it's fragile."
Airliners also stumbled after American Airlines trimmed its profit guidance for the year. Shares of American fell 1.38, or 4.1%, to 32.04 and pulled other airline carriers, including United Continental Holdings and Southwest Airlines, down with it.
Elsewhere, most major indexes in Asia closed lower after data showed that consumer prices in China rose at their slowest pace in six months, potentially hurting corporate profits in the country.
The Stoxx Europe 600, meanwhile, added 0.3%, recouping an earlier loss that followed a report that showed industrial production in France had unexpectedly fallen in November.
With Thursday's gains, both the S&P 500 and Dow industrials are up more than 2.5% since the start of January after a strong December jobs report and signs that the Fed will take a more dovish approach re-energized investors.
Progress on a new trade pact between the U.S. and China has also helped sentiment this month.
Trade negotiators from Washington and Beijing wrapped up their first face-to-face talks since a temporary truce was announced last month. Analysts had been hopeful some concessions would be announced, as escalating tariffs have weighed on the world's two largest economies and global equity markets.
Still, analysts say a firm resolution is needed to ease the harsh volatility. Without that, major indexes like the S&P 500 will struggle to recoup the losses suffered since hitting its last record in September.
"On some of these really intractable issues, like market access and intellectual property, the U.S. wants to see more than just pledges," said Steve Friedman, a senior economist at BNP Paribas Asset Management
Write to Michael Wursthorn at Michael.Wursthorn@wsj.com and Avantika Chilkoti at Avantika.Chilkoti@wsj.com