There has been no change to the rate of inflation which remained at 2%, the target rate for the Bank of England, according to official figures.
It means prices in June rose at the same rate as in May, data from the Office for National Statistics showed.
Money latest: Number of people claiming non-dom status rises
Inflation was unchanged as hotel prices rose strongly and second-hand car costs fell at a slower pace than last year.
Clothes sales also brought costs down, the ONS said, while raw material costs also fell.
The figure is higher than expected, economists had forecast a slight fall to 1.9%.
The absence of a fall is likely to be unwelcome news to the interest-rate setters at the Bank of England who have kept borrowing high to bring inflation down to 2%.
Card spending falls for the first time in more than three years, Barclays says – as inflation slows and consumers cut back
Inflation fall is welcome – but financial situation households are in compared to five years ago is stark
UK inflation drops to Bank of England’s 2% target for first time in nearly three years
An interest rate cut would be good news for mortgage holders and people paying back other forms of debt like loans or credit card bills.
Keep up with all the latest news from the UK and around the world by following Sky News
But the market expectation is still on a knife edge as to whether there’ll be a cut in August.
Key figures possibly influencing Bank of England officials to leave the interest rate unchanged are two other measures of inflation – services and core.
The cost of services grew by 5.7% – the same as a month earlier.
Similarly core inflation, which excludes fuel and food in measuring price rises, stayed at 3.5%.
Be the first to get Breaking News
Install the Sky News app for free
Darren Jones, chief secretary to the Treasury, said:
“It is welcome that inflation is at target, but we know that for families across Britain prices remain high. We face the legacy of fourteen years of chaos and economic irresponsibility. That is why this government is taking the tough decisions now to fix the foundations so we can rebuild Britain and make every part of Britain better off.”