Current inflation rate in the UK
Image copyright PA
The UK's inflation rate turned positive in July, with the Consumer Prices Index measure rising to 0.1% from June's 0%.
CPI has been almost flat for the past six months, having turned negative in April for the first time since 1960.
The ONS said falling food and non-alcoholic drink prices partially offset the positive impact of the smaller rise in clothes prices.
The underlying measure of CPI inflation, which strips out increases in energy, food, alcohol and tobacco, rose to 1.2% in July, a five-month high.
"This is the sixth month running that headline inflation has been at or very close to zero, " said Richard Campbell from the ONS.
"While households will have seen individual prices rise and fall, the overall shopping basket bought by the country remains little changed in price compared with a year ago."
Analysts say the inflation rate could fall back again, partly due to the drop in the price of oil, which has slumped by nearly a quarter in the past two months.
"This morning's inflation figures are higher than expected, but could easily fall back next month, " said Peter Cameron at EdenTree Investment Management.
"Brent Crude has dropped below $50 a barrel and China, the world's largest exporter, is potentially now unleashing a new wave of deflationary forces around the world through the devaluation of its currency."
Analysis: Robert Peston, BBC business editor
There has been considerable speculation over when the Bank of England - which has a target inflation rate of 2% - might start to raise interest rates. However, Mr Cameron said it was "hard to envisage a rate rise this side of Christmas".
Samuel Tombs from Capital Economics said raising rates could be postponed until the second quarter next year, with inflation "likely to turn negative again over the next few months".
However, the pound strengthened against the dollar immediately after the inflation rate was announced, reflecting the fact that the rate was higher than expected. The pound rose by almost a cent to $1.5667. This suggests that many investors felt the rise in inflation made an early rate rise more likely.
"The pick-up in core inflation reinforces the case for interest rates to start rising sooner rather than later, so the [Bank] does not fall behind the monetary policy curve, " said PwC's John Hawksworth.