The rate of price rises has dropped to 7.9% in the year up to June, according to the Office for National Statistics (ONS).
The consumer price index (CPI) measure of inflation shows prices are still rising, just at a slower pace than before, as the rate fell from 8.7% in the year to May.
Another measure of inflation, closely watched by the Bank of England when deciding whether to increase interest rates, also fell.
Core inflation – the rate of price rises that excludes food and fuel – dropped to 6.9%. The rate had been increasing since January this year.
It had been expected the core inflation would remain stuck at the same level as the month before – 7.1% – and that CPI would only fall to 8.2%.
But falling petrol and diesel costs, and a slowing down in food price rises, led to the surprise drop.
The rate of food inflation fell to 17.3% in June from 18.3% in May.