U.S. retail sales increased 1.2% in August to $773.9 billion, rebounding from a 0.5% decline in July, according to the Commerce Department. The result exceeded economists’ forecast of 0.8% growth.

Although higher gasoline prices lifted overall spending, sales excluding gas stations remained resilient. The retail sales “control group,” which is used to calculate gross domestic product, rose about 1.4%.

Online retail sales increased 2.6%, while spending at electronics and appliance stores and other discretionary categories rose 1.6%. Bank of America data also showed that seasonally adjusted credit- and debit-card spending per household climbed 0.9% in August.

The stronger retail figures, combined with a better-than-expected August employment report, suggest that the U.S. economy remains resilient. Analysts said the data could also give the Federal Reserve more room to raise interest rates to curb inflation.