UK retail sales increased in July as stronger spending on food offset a fall in the purchase of other goods, according to official figures.
The volume of sales grew by 0.3% compared with June, the Office for National Statistics (ONS) said.
However, the figure for June's retail sales growth was revised down from 0.6% to 0.3%.
The latest data shows that the volume of food sales rose by 1.5% in July, having fallen by 1.1% in June.
The ONS said all other sectors saw a fall in volume sales apart from household goods.
Ole Black, ONS senior statistician, said that overall it was a "relatively subdued picture" in retail sales".
"Strong food sales have been responsible for the growth of 0.3% in July compared with June, as all other main sectors have shown a decrease. Whilst the overall growth is the same as in June, trends in growth in different sectors are proving quite volatile," he said.
However, Ruth Gregory, UK economist at Capital Economics, said the July figures were "fairly encouraging given the recent intensification of the squeeze on consumers' real incomes and suggest that talk of a sharp consumer slowdown has been overdone".
She said there had been few signs of a sharp slowdown in spending growth away from the high street.
"What's more, with annual retail sales values growth remaining at a still strong 4.1% in July, this suggests that consumers haven't been tightening their belts as a result of Brexit uncertainty," she said.
Ben Brettell, senior economist at Hargreaves Lansdown, said the figures showed the UK consumer was "extraordinarily resilient".
"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," he added.
"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."
However, the continuing difficulties for retailers was underlined on Thursday when Kingfisher reported a 1.9% fall in like-for-like sales for the three months to 31 July.
The group's operations include DIY chain B&Q, whose sales fell 4.7%.
PwC economic advisor, Andrew Sentance said the underlying picture on the High Street remained one of "subdued growth".
"Consumers may also be becoming more cautious about spending because of the political uncertainty following the General Election and surrounding the Brexit process.
"However, the main factor squeezing consumers is the weakness of the pound against other major currencies which is pushing up import prices and fuelling inflation," he added.
"UK consumers are watching and waiting - for inflation to subside and for the post-Brexit to become clearer. Until there is some relief on these two key issues, subdued growth of retail sales looks set to continue through this year and into 2018."