UK inflation rose to 2.5% in July, after holding steady at 2.4% in the previous three months as the cost of transport and computer games increased.
It was the first jump in the Consumer Prices Index (CPI) measure since November and was in line with forecasts.
Meanwhile the Retail Prices Index (RPI) measure of inflation fell to 3.2%.
The Department for Transport uses the RPI figure to set the maximum annual increase for regulated rail fares.
The latest Office for National Statistics figures show that increases in computer games and transport were partially offset by falls in the price of clothing.
For manufacturers, the cost of raw materials was 10.9% higher than in July 2017, the biggest rise in more than a year.
Much of that cost pressure has been caused by oil price increases of more than 50% over the period.
The CPI figure had hit a five-year high of 3.1% in November, when the inflationary effect of the pound’s fall following the June 2016 Brexit vote reached its peak.
Earlier this month the Bank of England forecast inflation would rise to 2.6% in July before falling back.
The Bank expects inflation will settle down to just above its 2 % target in two years’ time as it gradually increases borrowing costs.
On Tuesday, official data showed average earnings, excluding bonuses, rose by an annual rate of 2.7% for the three months to June.