NEW YORK (AP) — Shoppers increased their spending at a better-than-expected pace in August from July, helped by back-to-school shopping, according to a new federal government report.

Retail sales rose 0.6 percent last month from July, when sales were up a revised 0.6 percent, according to the Commerce Department’s report. In June, retail sales rose 0.9 percent.

The August performance was also likely helped by the continued efforts by Americans to keep pushing up purchases ahead of expected price increases.

The retail sales increases followed two straight months of spending declines in April and May.

Excluding auto sales, which have been volatile since President Donald Trump imposed tariffs on many foreign-made cars, retail sales rose 0.7 percent in August.

Sales at auto vehicle and parts dealers rose 0.5 percent.

The data showed solid spending across various other outlets. Business at electronics and appliance stores was up 0.3 percent while online retailers had a 2 percent increase. Business at clothing and accessories retailers rose 1 percent.

Business at restaurants, the lone services component within the Census Bureau report and a barometer of discretionary spending, rose 0.7 percent.

“This is further evidence that we shouldn’t underestimate the strength of the consumer,” Bankrate senior industry analyst Ted Rossman wrote in a note. “Back-to-school shopping was a key theme in August, as evidenced by the strong clothing and electronics sales.”

Government retail data isn’t adjusted for inflation, which rose 0.4 percent from July to August, according to the latest government report. That was faster than the 0.2 percent pace the previous month. So that could have inflated the sales figures as well.

Inflation rose last month as the price of gas, groceries and airfares jumped while new data showed applications for unemployment aid increased.

Consumer prices increased 2.9 percent in August from a year earlier, the Labor Department said last week, up from 2.7 percent the previous month and the biggest jump since January.

Excluding the volatile food and energy categories, core prices rose 3.1 percent, the same as in July. Both figures are above the Federal Reserve’s 2 percent target.

Core prices rose 0.3 percent for the second straight month.

Earlier this month, the Labor Department reported that employers — companies, government agencies and nonprofits — added 22,000 jobs last month, down from 79,000 in July and below the 80,000 that economists had expected.

The unemployment rate ticked up to 4.3 percent, the highest since 2021.

Major retailers including Walmart, Macy’s and Best Buy recently reported their quarterly results, underscoring that shoppers are still buying, but are choosy. Some have raised prices but many, including Home Depot and Macy’s, have described the hikes as modest.

Still, so far, shoppers haven’t felt the big sting as some economists predicted earlier in the year as many retailers had ordered goods ahead of the implementation of new tariffs and absorbed a big chunk of the costs as they came in, worried about passing on any hefty price increases to consumers.

The price gains have also been gradual enough to mute changes in consumer spending behavior, Walmart CEO Doug McMillion told analysts last month after the nation’s largest retailer reported its fiscal second-quarter earnings results.

Walmart and others, however, have said they expect to see costs increase as they replenish inventory at post-tariff levels.

Jewelry maker Pandora hasn’t announced specific price increases, but Pandora CEO Alexander Lacik said in a call with analysts last month that the company is monitoring the scenario.

He noted that “the U.S. consumer will eventually have to bear the brunt of these tariffs,” but added, “it’s not just on jewelry, it’s on many product categories. So the big question mark is, what happens with inflation in the U.S., unemployment rates, all sorts of other macro drivers, and I think this is ahead of us.”

Matt Priest, president and CEO of trade group Footwear Distributors and Retailers of America, told reporters earlier this week that members are starting to pass along price increases to shoppers.

Its members had previously paid a total of $3 billion in tariffs annually for years; that number is now on track to hit $5 billion by year-end. He warned that women’s shoes will be affected first.

“Women’s shoes are more fashion-oriented,” Priest said. “Our ability to front-load women’s product based on fashion trends was limited, and so we are seeing that those increases start to hit consumers first.”