Inflation unexpectedly stalled last month as higher prices for motor fuel, gas and electricity were offset by deeper discounting by clothing retailers.

Figures from the Office for National Statistics (ONS) show the Consumer Prices Index (CPI) rate of inflation held steady at 2.4% in June, unchanged from a month earlier.

Economists were expecting inflation to rise to 2.6%.

ONS head of inflation Mike Hardie said: “Consumers have been feeling the benefit of the summer clothing sales, and computer game prices have also fallen.

“However, gas and electricity and petrol prices all rose, with consumers seeing the highest price at the pump for nearly four years, with inflation remaining steady overall.”

The pound dropped sharply after the inflation data, falling 0.7% against the US dollar at 1.30 and was 0.3% lower at 1.12 euros.

A recent jump in oil prices has raised the price of motor fuel, with petrol rising 2.7p per litre on the month to 128p per litre, while diesel rose 2.9p to 132.1p.

It marks the highest level for both petrol and diesel since September 2014.

Households were also squeezed by gas and electricity costs, which rose 2.5% and 2.2% respectively, month on month.

Some of the largest energy suppliers – including British Gas, Scottish Power, and EDF Energy – have announced price rises set to kick in over the summer.

But some relief emerged for consumers on the high street, where clothing discounts – most strongly felt in men’s apparel – left more cash in shoppers’ wallets.

Prices usually fall between May and June as summer sales get under way, but the 2.3% drop this year compares with a 1.1% fall a year ago, and is the largest decline during the same period since 2012.

There was also a drop in the prices of games, toys and hobbies, particularly in the cost of computer games.

It helped prices for recreation and culture drop 0.4% between May and June this year, though the statistics agency noted that prices for computer games are heavily dependent on the make-up of bestseller charts, leading to significant fluctuations from month to month.

Food prices eased by 0.6%, due primarily to a drop in fruit prices and a category that includes syrup, sugar, jam, chocolate and confectionery, for which prices fell 1.1% and 1.3% respectively.

Vegetables – including potatoes – also fell 0.9% month on month.

The Retail Prices Index (RPI), a separate measure of inflation, was 3.4% last month, up from 3.3% in May.

The Consumer Prices Index including owner-occupiers’ housing costs (CPIH) – the ONS’s preferred measure of inflation – was 2.3% in June, in line with May’s reading.

Mr Hardie said: “House prices rose at their slowest pace in nearly five years due to slow annual growth in the South and East of England. However, this was partially offset by the buoyant property market in the Midlands.”