NEW YORK (AP) -- Stocks rose on Wall Street Tuesday following more signs the nation's punishingly high inflation may be falling off faster than expected.
The S&P 500 climbed 0.9%, or 34.48 points, to 3,991.73, though it went on another unsettling ride to get there. A flare-up of worries about the war in Ukraine caused a brief pullback in markets during the afternoon, forcing the S&P 500 to swing from an early gain of 1.8% all the way to a loss of 0.1% before it recovered.
The Dow Jones Industrial Average veered from a gain of 450 points to a loss of 216 before closing at 33,592.92, up 56.22 points, or 0.2%. The Nasdaq composite led the market with a gain of 1.4%, or 162.19 points, to close at 11,358.41.
When Wall Street opened for trading, the overall mood was ebullience as stocks bounced following the latest data suggesting inflation continues to cool from its summertime peak. A meeting between the presidents of the world's two largest economies also raised hopes for an easing of U.S.-Chinese tension after analysts called it better than expected.
The S&P 500 touched its highest level in two months, while Treasury yields eased on hopes a slowdown in inflation could mean the Federal Reserve's bitter, economy-crunching medicine for it could taper as well.
But the gains for stocks disappeared following reports that apparent Russian missiles crossed into Poland, which is a member of NATO.
Prices for crude oil jumped as stock prices fell, an indication traders were building bets for aftershocks from an escalation in the war in Ukraine. Beyond the human toll, a worsening war could cause spikes in prices for oil, gas and other commodities that the region produces, which could worsen inflation.
Stocks then recovered and began climbing anew as the afternoon progressed.
"Inflation is still top of mind and market moving," said Nate Thooft, senior portfolio manager at Manulife Investment Management. "Anything that potentially swings the inflation story, the market is keen to react."
Such sharp hourly swings for stocks have almost become the norm on Wall Street this year, as high inflation and interest-rate hikes by the Federal Reserve have heightened fears and triggered knee-jerk reactions. "The market remains adrift looking for a good narrative that will stick but seemingly not finding it," Thooft said.
Through Tuesday's swings, technology stocks continued to lead the way on Wall Street.
They're usually some of the most sensitive to changes in interest rates, as rises in rates hit hardest on stocks seen as the most expensive, most risky or forcing investors to wait the longest for big growth.
Chipmaker Nvidia rose 2.3%, and Apple gained 1.2%.
Traders have been paring their bets for how big a hike the Fed will announce at its next policy meeting in December. Such speculation started in earnest after a report last week showed inflation at the consumer level slowed more than expected in October.
On Tuesday, hopes built further after a separate report showed inflation at the wholesale level eased back to 8% in October from 8.4% a month earlier. That was even better than the 8.3% economists were expecting.
"The improvement is simply encouraging," said Mark Hackett, chief of investment research at Nationwide. "More importantly, what it's doing is taking universal pessimism and starting to put some holes in that theory."
The Fed has already hiked its key overnight rate up to a range of 3.75% to 4% from virtually zero earlier this year. It has said it still plans to hike rates further and then to hold them at that high rate for a while in order to grind down inflation. The hope for markets is that the recent improvements in inflation data could mean the Fed ends up holding rates at a level that's not as punishing for Wall Street.
Rate increases can cause a recession because they slow the economy, and they also drag down prices of stocks and other investments.
Bond yields, which have been hovering near multidecade highs, eased. The yield on the two-year Treasury fell to 4.34% from 4.40% late Monday. The yield on the 10-year Treasury, which influences mortgage rates, fell to 3.76% from 3.85%.
Investors will get more updates on inflation's impact on businesses and consumers this week with corporate earnings from big retailers.
Walmart jumped 6.5% after reporting strong financial results, raising its profit forecast and announcing an opioid settlement.
Target reports its results on Wednesday, and Macy's reports its results on Thursday.
Wall Street will get a broader update on retail sales Wednesday when the government releases its report for October.