The UK’s consumer prices index (CPI) measure of inflation rose to 2.9% in May, up from 2.7% in the previous month.

The headline rate of annual price inflation was driven up primarily by a rise in the cost of recreational and cultural goods and service.

Prices in this category rose 0.9% between April and May, compared to a fall of 0.4% a year ago. Major inflationary contributions came from games, toys and hobbies – particularly computer games – while the cost of package holidays also rose.

Food prices rose only “slightly” between April and May this year compared to a fall a year ago.

The category added 0.17 percentage points to headline inflation this month, having dragged it back by 0.24 percentage points this time last year.

The Office of National statistics said this latest food price rise continues the upward movement observed from late 2016 and comes from a variety of product groups, particularly sugar, jam, syrups, chocolate and confectionery where prices of cartons and boxes of chocolates rose between April and May this year.

Prices for clothing rose by 0.6% between April and May this year compared with a fall of 0.3% a year ago, while prices for furniture and household goods rose by 1.2% between April and May this year.

By far the largest downward contribution this month came from the transport group. This came from motor fuels and transport services, particularly air and sea fares. Petrol and diesel prices each fell this year, by 1p and 1.6p per litre respectively – the third successive month of price falls.

Commenting on the ONS release, Richard Lim, chief executive of Retail Economics said: “Inflation surged to its highest rate in four years as the impact of past falls in sterling continue to feed through to households.

“This confirms that real earnings are well and truly shrinking. With underlying conditions for households set to weaken even further in the coming months, confidence will be further damaged by heightened political uncertainty and legitimate concerns over what form Brexit is likely to take.”