The numbers: Sales at U.S. retailers such as Amazon and Best Buy posted the biggest increase in July in four months, a sign Americans are still confident in the economy even as headwinds pick up.

Retail sales increased 0.7% last month, the government said Thursday. Economists polled by MarketWatch had forecast a 0.3% increase.

Sales rose an even stronger 0.9% if auto dealers and gasoline stations are omitted. Car and fuel purchases sometimes distort broader retail trends.

Read:Tariff delay on popular consumer goods like iPhones expose Trump’s China strategy

What happened: Sales soared 2.8% at internet retailers, a gain that may have been tied to Amazon Prime Day and competing sales from rivals.

Read:Amazon Prime Day boosts British retail sales in July

It wasn’t just internet retailers, though. Sales also rose sharply at department stores, restaurants and electronics outlets.

A spike in oil prices boosted sales at gas stations by 1.8%, but price at the pump began to recede in August. Retail sales were strong even if gas stations are set aside.

Sales fell at auto dealers and stores that sell music, books and sporting goods.

Read:Trump is already painting the Fed as the scapegoat if the economy tanks

Big picture: The steady pace of consumer spending at local retail stores and Internet sites is a reassuring sign for a U.S. economy that’s facing mounting hurdles, particularly a festering trade dispute with China that’s sent Wall Street stocks tumbling. Economic growth has slowed around the world and that could also spell trouble at home.

The saving grace for the economy is a healthy labor market and low unemployment rate that’s given households enough confidence to spend at levels sufficient to keep the U.S. out of recession.

Assuming, that is, the U.S. trade fight with China doesn’t get any worse.



Read: Trump delays tariffs on Chinese-made laptops, iPhones until after Christmas

What they are saying?: “The consumer sector is rocking-and-rolling,” said chief financial economist Ward McCarthy of Jefferies LLC.

“The U.S. consumer continues to prop up the economy, despite the building headwinds to growth from trade disruptions and signs of weakness from other industrialized nations,” said senior economist Ben Ayers at Nationwide.

Market reaction: The Dow Jones Industrial Average DJIA, +1.33% and the S&P 500 index SPX, +1.59% rose slightly in Thursday trades, a day after the Dow lost 800 points. Stocks have been battered this month from an intensifying U.S. trade dispute with China that appears to have weakened the global economy.