The latest government data showed retail sales rose 0.7 percent last month.
This followed a 0.1 per cent rise in May, a figure which the Office for National Statistics had revised down to 0.3 per cent.
Experts had forecast a 0.2 percent rise in June, according to an average provided by Pantheon Macroeconomics.
The increase in June was across the board, with most major retail sectors seeing an increase in their sales, apart from petrol and diesel sellers.
Department stores and furniture sellers said sales increased due to higher summer sales in warmer weather.
Food stores, which had seen a 0.4 percent drop in May, rebounded to a 0.7 percent increase in June, the ONS said.
Grant Fitzner, chief economist at the ONS, said: “Retail sales rose strongly, food sales were boosted by the impact of an extra bank holiday, partly helped by good weather, and department stores and furniture stores also had a strong month.
“However, these were partially depleted due to falls in fuel, garden centers and clothing stores.
“Growth still fell on an annual basis, but at its slowest rate since the start of the Ukraine war.”
Helen Dickinson, chief executive of the British Retail Consortium, said: “The June sunshine boosted retail sales as consumers braced themselves for summer, with products in sectors such as fashion, skincare and books performing particularly well.
“However, consumer confidence remains weak, and with households feeling the pinch from high inflation and rising interest rates, they have put off big-ticket purchases, particularly in sectors such as electrical.
“Retailers are optimistic that consumer confidence will improve with inflation softening in the coming months.
“Falling inflation rates are a clear sign that competition is driving down prices where cost pressures ease.”
But he added: “While retailers are doing their bit, the government has a role to play in bringing down inflation.
“Costly reforms to the packaging levy and a new deposit return scheme could combine to add £4bn to retailers’ costs, putting renewed pressure on prices.
“The government should review the timelines for these interventions so that the current difficult environment is not made more difficult for households and businesses.”
Aled Patchett, head of retail and consumer goods at Lloyds Bank, said: “The increase in sales is somewhat unsurprising as record temperatures encourage consumers to spend on summer clothing and outdoor gear.
“The combination of persistently rising interest rates and the high cost of living is making buyers less willing to spend on discretionary goods.
“That said, a reduction in energy use during the summer months can provide relief to households, freeing up some disposable income.”