Specialists James Denaro, left, and Anthony Rinaldi work on the floor of the New York Stock Exchange. The U.S. stock market opens at 9:30 a.m. EDT on Thursday, Aug. 15.

U.S. stocks steadied themselves Thursday amid hopes that the heart of the economy shoppers spending at stores and online can stay strong and help avert a recession. Caution continued to dominate markets around the world, though, on worries that economies are already sliding down the slope.

The S&P 500 rose modestly in morning trading and clawed back a fraction of its steep losses from the prior day, when stocks tumbled after the bond market sent out a fairly reliable warning signal of recession. Stocks from Tokyo to London, meanwhile, sank 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.

The U.S. bond market, which has been among the loudest and earliest to cry out warnings about weaker economic growth and inflation, also continued to show concern as yields fell.

Bond prices jerked up and down through the morning, much like markets around the world. Trading has been disjointed in recent weeks as investors flail from one moment of uncertainty around Trumps trade war to another.

In the U.S., Walmart shares surged 4.4% and helped 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. A separate government report also showed that retail sales were stronger than economists expected last month.

The S&P was up 0.1%, as of 10:30 a.m. Eastern time, after flipping between a loss of 0.2% and a gain of 0.6%. A day earlier, it plunged nearly 3%.

The Dow Jones Industrial Average rose 8 points to 25,487, and the Nasdaq composite was barely changed.

Consumer spending makes up the bulk of the U.S. economy, and shoppers have been carrying the economy recently amid worries that businesses will pull back on their spending due to all the uncertainty created by the trade war. Other economies are slowing as the trade war is doing damage to manufacturers around the world.

Those concerns helped drive the yield on the 10-year Treasury to 1.56% Thursday, down from 1.58% late Wednesday and from more than 3% late last year. The 10-year yield has sunk so much that it dropped below the yield of the two-year Treasury Wednesday, a rare occurrence and one that has historically suggested a recession may be a year or two away.