Consumers cut back on their shopping in August by the largest amount in six months as declining auto sales offset gains in other areas.

Retail sales fell 0.2 percent last month after a 0.3 percent gain in July, the Commerce Department said Friday. It was the biggest one-month drop since an identical decline in February. Auto sales sank 1.6 percent, the most in seven months.

Excluding autos and gas, which tend to be volatile from month to month, sales dipped 0.1 percent in August after having risen 0.5 percent in July.

Analysts said the weaker-than-expected August sales were weighed down in part by the initial disruptions from Hurricane Harvey on the Gulf Coast. Another factor, they said, was some pay-back from July, when sales had been boosted by the Amazon Prime Day sales promotions.

Economists also noted some downward revisions to previous months, with sales in July downgraded to a 0.3 percent gain, just half the initially reported increase. But they said they remained optimistic about consumer spending in the coming months, thanks in large part to a still-solid job market.

"With consumer confidence close to record highs and the labor market continuing to improve ... we doubt this is the start of a more sustained downturn and expect retail spending to bounce back over the coming months," said Andrew Hunter, U.S. economist at Capital Economics.

Sales rose last month at general merchandise stores, a category that includes big-box retailers such as Target. Rising gasoline prices also boosted sales.

The overall economy, as measured by the gross domestic product, grew at a robust 3 percent annual rate in the April-June quarter, more than double the lackluster 1.2 percent rate in the first quarter. Analysts generally predict that growth in the current July-September quarter will remain in a solid range of 2.5 percent to 3 percent, with a key boost coming from consumer spending.

The consumer sector, which contributes to 70 percent of economic activity, is benefiting from the lowest unemployment rates in 16 years and continued strong hiring.

For August, gasoline sales were up 2.5 percent, the biggest jump since last December. But that increase reflected in large part rising prices.

Sales at general merchandise stores, which includes big-box retailers such as Walmart and Target, were up 0.2 percent although sales at department stores including Macy's, edged down 0.1 percent. Sales at non-store retailers, a category that covers booming online sales, dropped 1.1 percent in August after a 1.8 percent gain in July.