Retail sales rose at a 0.5 percent annual rate in July, after a 0.2 percent increase the previous month, the Commerce Department said Wednesday. June's increase, though, was revised lower from a previous estimate of a 0.5 percent annual rate.

Consumers appear to be feeling upbeat and are in overall solid financial shape. The unemployment rate is near an 18-year low. And economic growth, along with hiring, has accelerated. On average, Americans are saving more, which may encourage future spending.

Sales last month rose at auto dealers and grocery stores and jumped at clothing shops. Americans boosted their spending at restaurants and bars at a 1.3 percent in July from June. Gas station sales increased at a 0.8 percent annual rate from a month earlier.

Spending at restaurants and bars has jumped nearly 10 percent from a year earlier. That's a bigger increase than for online shopping, which rose 8.7 percent from a year ago.

It also bolsters the notion that many Americans feel they have enough money to spend on non-necessities.

"Restaurants are a highly discretionary category, and continued strength suggests that households are not too worried about higher gas prices and that tax cuts are providing a cushion against higher expenses at the pump," Ellen Zentner, an economist at Morgan Stanley, said in a research note.

Department stores, which have suffered falling sales and bankruptcies for much of the past two years, reported a surprisingly healthy sales gain of 1.2 percent. Macy's said Wednesday that sales at stores that have been open for at least a year rose unexpectedly in the quarter that ended Aug. 4, its third straight quarterly gain.

The solid spending figures coincide with other data suggesting that American households are in decent financial shape. The government last month revised the savings rate sharply higher, to 7.2 percent in the first quarter from 3.3 percent. And fewer people are falling behind on their loans.

More savings could fuel future spending growth. Before the data was revised, some economists had worried that consumers would have to cut back on their shopping because the savings rate was declining.

"It gives us comfort that consumers are nowhere near to being as overstretched as they were in the years heading into the Great Recession," Michael Feroli, an economist at JPMorgan Chase, wrote in a research note.

The savings rate is the difference between all Americans' income and spending and is skewed higher by greater saving among higher-income households.

A separate report Tuesday by the Federal Reserve Bank of New York showed that Americans are borrowing more even as interest rates rise. That is a sign of confidence that households can pay off the debts. Higher credit card debt and more mortgage and auto loans drove the increase.

The report showed that Americans are paying off the loans. The percentage of borrowers falling 30 days or more behind on loan payments declined slightly to 4.5 percent, down from roughly 6 percent four years ago.

Still, U.S. households are facing some headwinds. Higher gas and housing costs lifted inflation to an annual rate of 2.9 percent in July, the highest in six years. That more than offset the average hourly wage gains of 2.7 percent that Americans have received in the past year.