Stefan Wermuth / Reuters
The ONS' data shows that retail sales jumped 5.9% on a year-on-year basis, up from 4.3% in June, and well above the 4.2% growth that had been forecast by economists.
On a monthly basis, sales grew 1.4% compared to a 0.9% fall in June, and against a forecast of 0.2% growth.
Retail sales excluding fuel - a highly volatile component - also grew more than expected, jumping 5.4% y-o-y and 1.5% month-on-month. This compared with expectations of 3.9% and 0.4% growth.
Here is the ONS' chart:
Office for National Statistics
While retail sales grew strongly in the month, it should be noted that consumer spending is always a volatile measure of activity, and can oscillate wildly from month-to-month, meaning that July's data may not yet reflect any impact on shoppers by the Brexit vote.
Since the UK's vote to leave the EU, economic data and sentiment surveys have almost universally showed a slowing of activity in the country. Markit's PMI surveys for Britain's construction, services, and manufacturing sectors all point to the UK falling into a mild recession in the next year,although the Bank of England believes that the country will narrowly avoid one.
However, in the past couple of days, data from the ONS has painted something of a different picture, with unemployment falling again and the number of people claiming benefits also dropping.