U.S. households ramped up their spending in July, providing reassurance that the economy’s decadelong expansion continued to roll despite slowing factory activity and global growth.

Personal-consumption expenditures, a measure of household spending, increased a seasonally adjusted 0.6% in July from June, a pickup from the previous two months, the Commerce Department said Friday, continuing a solid performance by the economy’s main driving force.

“The consumer is still very sturdy and providing fundamental strength to the overall economy,” said Jack Kleinhenz, chief economist at the National Retail Federation. “As long as we see a strong job market...the direction of the economy continues to be on track: positive but slowing.”

The prospects for continued strong spending ahead are less clear. Consumer sentiment fell in August, posting its largest drop since 2012, the University of Michigan said Friday. Richard Curtin, the survey’s chief economist, attributed the decline to Americans’ concerns about tariffs.

“The data indicate that the erosion of consumer confidence due to tariff policies is now well under way,” Mr. Curtin said.