Dearer air fares, the rising cost of driving and more expensive computer games pushed the cost of living in the UK higher last month.
Figures from the Office for National Statistics showed that the consumer prices index rose by 0.5% in the year ending in June, up from 0.3% in May.
While the ONS said the inflation rate remained low by historic standards, City analysts said further increases are likely in the coming months as the fall in the value of the pound raises the cost of imported goods and services.
The ONS said prices had risen by 0.2% between May and June this year but had remained unchanged over the same period of 2015. It collected the sample of the cost of around 700 goods and services before the EU referendum on 23 June.
A breakdown of the CPI showed that air fares rose by 11%, the biggest increase between May and June on record and the main factor behind the higher-than-expected inflation figure of 0.5%. Economists had been expecting 0.4% and ONS statistician Phil Gooding said the cost of flights had possibly been boosted by the Euro 2016 football championships in France.
There was also a jump of more than two pence a litre in petrol and diesel, which meant a more rapid increase in the cost of transport. But cheaper furniture and accommodation helped blunt the increase, the ONS said.
So-called core inflation, which strips out food, energy, alcohol and tobacco, also rose last month, from an annual rate of 1.2% to 1.4%.