The Office for National Statistics (ONS) said retail sales volumes rose by 1.3% from a revised 1.8% in April.
Economists polled by Reuters expected sales to rise by 0.5%.
The latest numbers will offer a little relief to retailers who have had a torrid time of late and may give the Bank of England opportunity to raise interest rates. Sterling rose almost half a cent against the dollar to $1.3430.
“Retailers suggested that a sustained period of good weather and Royal Wedding celebrations encouraged spending in food and household goods stores in May,” the ONS said.
Many high street retailers have been forced to axe staff and close stores as consumers become more cost conscious and shop online. House of Fraser became one of the biggest casualties. It plans to close more than half its stores, including its flagship Oxford Street outlet, with 6,000 jobs on the line.
And the latest victim, N Brown, which owns the JD Williams, Simply Be and Jacamo retailers plans to close 20 stores, putting 270 jobs in doubt. It blamed weak footfall on the high street for the move.
The bounce back in the last two months proves a slump in sales in February and March was down to so-called Beast from the East, which brought heavy snow and unusually cold weather.
Sales rose by 0.9% in the three months to May, compared with 0.2% in the three months to April, the ONS said.
Online spending for food (5.8%), department (17.4%) and clothing stores (17.6%) also continued to increase, achieving new record proportions of online retailing in May, the agency said.
Jeremy Thomson-Cook, chief economist at WorldFirst, warned a wedding and warm weather do not make the foundations for reliable growth.
“The UK retail environment is a tough one at the moment with businesses dealing with margin pressures and a changing demand and fulfilment landscape courtesy of the ecommerce sector while consumers are still under the yoke of almost non-existent real wage gains,” Mr Thomson Cook said.
“That being said, the British consumer can always be counted upon to hit the High St in preparation of an event such as the Royal Wedding or World Cup and where the weather was good.
“May had this in spades but we cannot begin to think that this is the beginning of a resurgence of High St strength yet.”