(AP) -- Stocks on Wall Street shook off an afternoon slide and finished modestly higher Wednesday, clawing back some of their losses a day after the market's worst skid in two years.
The wobbly trading came as investors weighed another snapshot of inflation. Markets have been on edge about the possibility of a recession after a string of interest rate hikes by the Federal Reserve this year as the central bank fights inflation.
The S&P 500 rose 0.3% after wavering between small gains and losses much of the afternoon. The benchmark index was coming off its biggest drop since June 2020, which ended a four-day winning streak.
The Dow Jones Industrial Average closed 0.1% higher, while the Nasdaq composite rose 0.7%. Smaller company stocks also rose, pushing the Russel 2000 to a 0.4% gain.
Bond yields remained relatively stable after leaping higher on Tuesday. The yield on the two-year Treasury rose to 3.79% from 3.75% late Tuesday, when it soared on expectations for more aggressive interest rate hikes by the Federal Reserve.
The yield on the 10-year Treasury, which helps dictate where mortgages and rates for other loans are heading, held steady at 3.41%.
A report on inflation at the wholesale level showed prices are still rising rapidly, with pressures building underneath the surface, even if overall inflation slowed. It echoed a report on inflation at the consumer level Tuesday, which raised expectations for interest-rate hikes and triggered a rout for markets.
Still, the overall decline in inflation at the wholesale level helped assuage fears in the market that inflation at all levels is intensifying, said Quincy Krosby, chief equity strategist for LPL Financial.
"The market would have probably had another round of selling had the headline number been higher," Krosby said. "The fact that it dipped a bit was helpful for today's market."
Traders now see a one-in-four chance the Fed may hike its benchmark rate by a full percentage point next week, quadruple the usual move, according to CME Group. A day earlier, it was closer to a one-in-three chance. The site puts the probability of a three-quarter percentage point increase now at 76%, up from 69% on Tuesday.
The central bank has already raised its benchmark interest rate four times this year, with the last two increases by three-quarters of a percentage point.
The Fed is taking the aggressive action on interest rates to try and cool the hottest inflation in four decades. Tuesday's report on high prices jolted the market with signs that inflation is entering a more stubborn phase that could require an already resolute Fed to become more aggressive.
Wall Street is especially worried that the rate hikes could go too far in slowing the economy and send it into a recession. The Fed is trying to avoid that outcome, but the latest inflation reports reveal that is becoming a more difficult task.
All told, the S&P 500 rose 13.32 points to 3,946.01, while the Dow added 30.12 points to 31,135.09. The Nasdaq gained 86.10 points to 11,719.68, and the Russell 2000 picked up 6.89 points to close at 1,838.46.
Energy stocks had some of the biggest gains as U.S. crude oil prices rose 1.3%. Exxon Mobil rose 2.5%.
"Today you have some investors coming off the sidelines, coming back into the market because there's this feeling that the sell-off was a big one, there was a recalibration there, there was a little bit of panic selling there," said Sylvia Jablonski, chief investment officer at Defiance ETFs.
The broader U.S. economy has been slowing, but consumers have remained resilient and the job market remains strong. Wall Street will get another update on inflation's latest impact on spending when the government releases its retail sales report for August on Thursday.
The market is also monitoring U.S.-China tensions and war in Ukraine, while business and government officials are bracing for the possibility of a nationwide rail strike at the end of this week that could paralyze an already discombobulated supply chain.
The railroads have already started to curtail shipments of hazardous materials and have announced plans to stop hauling refrigerated products ahead of Friday's strike deadline. Businesses that rely on Norfolk Southern, Union Pacific, BNSF, CSX, Kansas City Southern and other railroads to deliver their raw materials and finished products are planning for the worst.
Union Pacific fell 3.7% and Norfolk Southern fell 2.2%.
Biden administration officials are scrambling to develop a plan to keep goods moving if the railroads shut down. The White House is also pressuring the two sides to settle their differences, and a growing number of business groups are lobbying Congress to be prepared to intervene and block a strike if they can't reach an agreement.