UK retail sales grew by 1% in August compared with the previous month, with sales of clothing and non-essential items reported as strong.
The Office for National Statistics (ONS) also said that compared with last August, sales volumes were 2.4% higher.
It was the 52nd month in a row that sales have risen.
However, the ONS said the rate of growth was slowing. It also said that prices for non-food sales had risen at their fastest rate in 15 years.
The figures add to evidence of rising inflation which has been fuelled, in part, by the drop in the pound’s value since the Brexit vote.
Last week, the Bank of England said this was likely to peak at 3% from its August figure of 2.9%.
The bank said it was likely to raise interest rates if inflation and the economy continued to remain strong.
The figures show higher prices had failed to stop consumer spending, despite the squeeze on wages, which have not been rising as fast as inflation.
Official figures last week showed wages in the three months to July were 0.4% lower in real terms than in 2016.
The ONS said: “Year-on-year contribution of food stores remains flat, while there was a fall in the contribution of growth within petrol stations, showing that contributions to the overall growth came from non-essential items.”
Retail prices increased across all store types on the year, with non-food stores and non-store retailing recording their highest year-on-year price growth since March 1992, at 3.2% and 3.3% respectively.
Ben Brettell, senior economist, at stockbrokers Hargreaves Lansdown, said the willingness of consumers to spend was surprising: “The UK consumer continues to show remarkable resilience, with retail sales in August blowing economists’ forecasts out of the water.
“Spending has defied expectations of a slowdown since the Brexit referendum, and currently seems to be holding up despite weak wage growth and above-target inflation.
“This could bode well for economic growth – the UK economy is heavily reliant on the consumer, and economists had expected falling real incomes to eventually translate into weak retail sales. If this fails to materialise, the economy could see a stronger second half to the year.”