A customer shops for shirts at an American Eagle Outfitters store in San Francisco.

U.S. consumers spent more at retail stores and restaurants in July, a sign that concerns over slower global growth that have roiled financial markets haven't dampened consumer confidence.

The Commerce Department says retail sales rose a healthy 0.7% last month, after a 0.3% gain in June. Online retailers, grocery stores, clothing retailers and electronics and appliance stores all reported strong gains.

Consumer spending, the primary driver of the U.S. economy, remains healthy even as other sectors of the economy, such as business investment, have weakened amid growing uncertainty over the U.S.-China trade war. Job growth is steady, the unemployment rate is near a 50-year low, and wages are rising modestly, which bolsters Americans' spending power.

Even department stores reported solid sales increases despite Wednesday's anemic earnings report by Macy's.