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 while second-hand car costs fell at a slower pace.
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%.
What it means for interest rates
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%.
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.
But the market expectation is now there will be no cut in August when Bank officials next meet to consider rates.
Before the inflation announcement markets priced in a 53% likelihood of no rate cut, according to data provided by the London Stock Exchange Group (LSEG). Those odds rose to a 65% chance of a cut.
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.
Core inflation – which excludes fuel and food in measuring price rises – stayed at 3.5%.
What happened to the pound
The pound is at a year high against the dollar and nearly a two-year high against the euro.
One pound buys more euro and dollars than at any point in the last nearly two years and year respectively.
Sterling’s value rose against the dollar on Wednesday with a pound equalling $1.30 for the first time since 18 July.
A pound buys €1.19 for the first time since early August 2022 – almost two years ago.
It’s good news for any Britons travelling to the US and to any of the 20 countries using the euro – their pound will now go further than it had done in the past 12 months for dollars and 23 months for euro.
Consumers more generally may also benefit if the rate remains good for sterling – the cost of importing goods bought with dollars and euro could be less.
Shoppers could benefit from lower costs for importers being passed on if exchange rates remain low.
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 14 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.”