Inflation increased to 2.6% in July, up from 2.4% in June, driven by the clothing and footwear sectors as well as transport fares.
It is the first time the consumer price index (CPI) figure had risen since March. Analysts had expected a fall.
The Retail Price Index increased to 3.2% from 2.8% in June.
Prices across clothing and footwear fell by 2.6%, which is the smallest fall in the category in July since 1996. In June the category showed a record fall in prices, slumping by 4.2%.
Transport prices jumped 1% in July against a 0.6% increase a year ago. Air fares soared 21.7% last month – the largest increase in July in eight years.
There were no significant downward pressures on inflation but most food categories had a small downward effect.