The Commerce Department said retail sales rose 0.7% in July, well above expectations of a 0.3% rise, as consumers bought a range of goods even as they cut back on motor vehicle purchases.

Walmart Inc. beat second-quarter analyst estimates and raised its full-year earnings outlook, sending shares of the world’s largest retailer up 6.1% and soothing concerns about waning consumer demand.

Those concerns were further eased when retail sales data surpassed analyst expectations. Consumers, who account for about 70% of the U.S. economy, stepped up their spending across the board in July.

The S&P 500 and the Dow gained ground in a late rally on Thursday as upbeat retail sales data offset recessionary fears amid the simmering U.S.-China trade tensions.

“The July number shows that the weakest economic data that people keep pointing out to for a global slowdown is coming from outside the United States not inside the U.S.,” said Randy Frederick, vice president of trading and derivatives for Charles Schwab in Austin. 

If there’s a global downturn, that will absolutely affect the U.S. economy because so much of our economic activity is impacted by international trade. But every actual result so far has shown the United States outperforming the rest of the world, which is probably because the United States is operating at the moment with pro-growth policies and the rest of the world is not.