LONDON (Reuters) - British retail sales unexpectedly edged up in July, helped by the strongest growth in online spending in three years, as consumers continued to support the economy before the Oct. 31 Brexit deadline.

FILE PHOTO - Shoppers during the Boxing Day sales on Oxford Street in central London, Britain December 26 2018. REUTERS/Henry Nicholls

Monthly retail sales volumes rose 0.2% after a 0.9% surge in June, the Office for National Statistics said on Thursday, beating the average forecast for a 0.2% decline from a Reuters poll of economists.

Compared with July 2018, sales were up 3.3%, slowing from 3.8% in June but at the top end of forecasts.

Britain’s economy contracted in the second quarter, a hangover from stockpiling before the original March 29 Brexit deadline, despite solid growth in household spending.

Thursday’s data suggested consumers continued to take Brexit in their stride, helped by modest inflation and wages growing at their fastest rate in 11 years.

That has aided the world’s fifth-biggest economy at a time when many companies have cut investment because of growing uncertainty about Brexit.

Sterling showed little reaction to Thursday’s data, which contrasted with a British Retail Consortium survey that showed spending fell in the year to July at the fastest pace on record for that month.

“Retailers won’t be getting carried away by these (ONS) figures,” Karen Johnson, head of retail at Barclays Corporate Banking, said.

“They will continue to be mindful of the looming Brexit threat and potential impact on their international supply chains, with possible cost increases and price rises on the horizon.”

In the three months to July, the ONS said, retail sales grew 0.5%, the smallest increase this year, reflecting a drop in sales volumes in May.

“Although still declining across the quarter, there was an increase in sales for department stores in July for the first time this year,” ONS statistician Rhian Murphy said. “Strong online sales growth on the month was driven by promotions.”

Online sales jumped 6.9% on the month, their biggest rise in volume since May 2016. Amazon held its annual “Prime Day” sales promotion last month, a major driver of sales for the company.

However, household-goods stores reported their biggest monthly drop in sales in two years, down 5.4%. Anecdotal evidence suggested warm weather had kept shoppers out of furniture and lighting stores.

Stable inflation, the strongest rise in wages since 2008 and some of the lowest unemployment rates since the mid-1970s have continued to boost household incomes, although after inflation wages are still below their peak before the financial crisis.

But there have been signs that consumers could turn more cautious as Britain’s political crisis drags on. Household savings relative to income is not far off record low levels.

News from retailers has been mixed. Fashion chain Next shrugged off Britain’s retail gloom on Wednesday and has reported a surprising rise in full-price sales.

But baby products retailer Mothercare blamed an uncertain and volatile home market coupled with fragile consumer confidence as reasons it would not report a rise in annual profit.