Investors rode out another turbulent day on Wall Street Thursday that kept stock indexes flipping between gains and losses until a late-day bounce gave the market a modest gain.
Worries about a possible recession collided with hopes that the strongest part of the U.S. economy -- shoppers spending at stores and online -- can keep going.
The major U.S. stock indexes spent much of the day reacting to big moves in U.S. government bond yields, which fell sharply in the early going, fluctuated for much of the day, and then recovered some of their decline by mid-afternoon.
U.S. government bonds have been among the loudest and earliest to cry out warnings about the economy. Stocks fell sharply on Wednesday after a fairly reliable warning signal of recession emerged from the bond market. Even after the slide in yields eased Thursday, the U.S. bond market continued to show concern as yields ended broadly lower.
Stocks in Asia and Europe paved the way for the volatile day on Wall Street early Thursday after China said it would take "necessary countermeasures" if President Donald Trump follows through on a threat to impose tariffs on more than $100 billion of Chinese goods on Sept. 1.
"What you're seeing really is what's been driving the market the last couple of weeks: Trade tensions as well as yield curve stress," said Lindsey Bell, investment strategist at CFRA.
The S&P 500 rose 7 points, or 0.2%, to 2,847.60. The benchmark index swung between a 0.6% gain and 0.5% loss. A day earlier, it plunged 2.9%.
The Dow Jones Industrial Average, coming off its worst day of the year, gained 99.97 points, or 0.4%, to 25,579.39.
Other indexes didn't catch the bounce. The Nasdaq composite dropped 7.32 points, or 0.1%, to 7,766.62, while the Russell 2000 index of smaller companies lost 5.87 points, or 0.4%, to 1,461.65.
Markets around the world have jerked up and down for weeks. Prices for everything from stocks to gold to oil have been heaving as investors flail from one moment of uncertainty around Trump's trade war to another around what central banks will do with interest rates.
In the U.S., Walmart climbed 6.1%, helping to steady the market after it said it made a bigger profit in the last three months than Wall Street expected, thanks in part to strong online sales of groceries.