US consumer spending rose more than anticipated in July, according to government data released Tuesday, boosted by online spending in a show of resilience even as the economy cools.

Retail sales in the world’s biggest economy advanced 0.7 percent to $696.4 billion last month, up from a revised 0.3 percent rise in June, said the Commerce Department.

Consumption has proven more robust than expected in the United States as households dip into savings accumulated during the pandemic, supporting growth while business activity slowed in recent months.

Analysts noted that spending deals offered on Amazon Prime Day — which took place in July — likely buoyed consumer purchases online.

Official data released Tuesday showed that the overall increase came on the back of a 1.9 percent rise at nonstore retailers, while sales at restaurants and bars picked up 1.4 percent from June.

But sales at auto dealers dipped 0.3 percent from June to July, while those at gasoline stations picked up 0.4 percent amid higher prices at the pump.

Selective spending

Despite the robust headline numbers, “beneath the surface there are signs that consumers are shifting and becoming more selective with their purchases,” said economist Oren Klachkin of Oxford Economics.

“Spending on expensive, interest rate-sensitive items such as motor vehicles and furniture weakened, but these losses were more than offset by gains in the other components,” he added.

These included food services and drinking spots, alongside leisure and hospitality spending.

“The bigger picture, though, is that consumption spending growth is slowing, albeit not collapsing,” said economists Ian Shepherdson and Kieran Clancy of Pantheon Macroeconomics in a recent report.

Clancy noted Tuesday that auto sales have come down slightly since January.

At least some of the growth in nonstore sales last month, he said, could reflect shifts in the timing of Amazon Prime Day since the pandemic, impacting seasonal adjustments.

“We expect a partial reversal of the July jump in the months ahead,” he said.

Economists have also pointed out that consumers are drawing down on excess savings while higher interest rates bite.

To ease demand and sustainably lower inflation, the Federal Reserve has raised rates rapidly, bringing them to the highest level since 2001 most recently.

The strong numbers on Tuesday will likely keep risks of tighter monetary policy on the table, Klachkin said.

But analysts expect the restart of student loan repayments from October will likely weigh on spending.

Beyond retail sales, a separate report released Tuesday indicated that business activity declined in New York State in August, according to a manufacturing survey.