That was above the median forecast for a rise of 2.7 per cent in a Reuters poll of economists and is faster than the growth in pay for most people.
Inflation climbed to a near four-year high of 2.9% in May, up from 2.7% the month before, according to official figures.
"The further increase in inflation - to its highest rate since June 2013 - primarily reflects retailers passing on higher import prices to consumers in earnest", said Samuel Tombs, the chief United Kingdom economist at Pantheon Macroeconomics.
The ONS said one of the main drivers for inflation in May was the increased cost of holidays overseas for British tourists who have to pay more for their euros and United States dollars.
Month-on-month, underlying consumer prices increased 0.1 percent, while it was expected to decrease by 0.1 percent.
But some economists suggested that the unexpected slowdown in inflation in recent months may cause the Fed to slow the pace of further rate hikes.
China Jan-May property investment rises 8.8% year-on-year
But some China watchers are more anxious about the risks of sharp slowdown next year. Retail sales increased 10.7% in May from a year earlier, unchanged from April.
Another big push on prices came from computer games and equipment, which are typically imported and therefore reflect the diminished buying power of sterling since the Brexit vote.
Growth slowed to 0.2 percent in the first quarter, partly because of weaker consumer spending, and the National Institute of Economic and Social Research estimates it hasn't picked up so far this quarter.
That was the smallest increase since last November and followed a 2.2 percent gain in April. "Nevertheless, given other pressures, including domestic political uncertainty, interest rates still seem set to remain on hold for now", Rhys Herbert, Senior Economist at Lloyds Bank Commercial Banking said in an emailed statement.
United Kingdom inflation climbed even higher in May as a weak pound continued to push up the prices of everyday goods and services. Central bank governor Urjit Patel kept the benchmark repurchase rate unchanged at 6.25 percent in a policy review last week, saying the easing of price pressures may be transient.
Core inflation, which excludes energy and food, rose a slight 0.1 percent in May. Prices in London alone rose by 4.7 per cent in April.
- Le smartphone contrôle la PS4 — PlayLink
- These Are The People Wounded In The Alexandria Baseball Shooting
- Children thrown to safety in London
- Steph Curry says he wouldn't go to the White House if invited
- France : une promesse, un rendez-vous et une angoisse
- MGM Resorts International (NYSE:MGM), First Majestic Silver Corp (NYSE:AG)
- Stephen Colbert predicts Trump impeachment at the Tony Awards
- New 'Spider-man' Playstation game unveiled
- MI health chief charged in Flint lead water crisis
- May fighting for survival after failed election