The rate of consumer price index (CPI) inflation increased to 2.9% in June, up from 2.7% in May, according to the Office for National Statistics (ONS).
The figure, a 14-month high, was lower than the 3% expected by markets.
A rise in the inflation rate had been anticipated because of higher petrol and clothing prices versus a year ago. But it was moderated by slower annual rises in airfares and food prices.
Retail prices index (RPI) inflation also rose, to 3.3% from 3.1% in May.
The RPI index is used to calculate many pensions, as well as inflation-linked government bonds. It is calculated differently as it includes some housing costs and other items not included in CPI, and is typically higher than the CPI measure.
The ONS said that air transport played the biggest role in dampening inflation this month, with fares falling 2.8% during June, compared with a 7.4% monthly increase in June 2012, due to lower European air fares in particular.
Despite falling somewhat back during the month, air fares in June were still 9.8% higher than they had been in June 2012 - which were in turn 21.3% higher than in June 2011.
Clothing and footwear prices fell 1.9% last month - as they typically do during the summer sales - but the fall was less than the 4.2% drop seen in June last year, which the ONS said had been the largest such decline on record.
Food prices fell half a percentage point during June, led by a fall of close to 2% in the cost of fruit and vegetables.
Despite reaching its highest level in over a year, the CPI measure remains well below the 4%-5% range experienced during much of 2011.
The Bank of England is supposed to keep CPI as close as possible to 2%. If it veers above 3%, the new Bank governor, Mark Carney, would be required to write a letter of explanation to the Chancellor George Osborne.
The lower-than-expected inflation rate also gives the Bank more leeway to pursue monetary stimulus, such as its buying up of government debts via quantitative easing, and its plans to start providing "forward guidance" from August - a commitment to keep interest rates at their historic low of 0.5% for longer.
The pound fell three quarters of a cent against the dollar to about $1.506 on the news, as markets took account of the likelihood of UK interest rates remaining at record lows.
"Presentationally, the surprise today is important," said Rob Wood, economist at Berenberg Bank
"With no letter required, it makes it marginally easier to introduce more formal forward guidance at the next policy meeting."
"Inflation is likely to bobble around 3% for the next few months before heading down towards the 2% target next year, as weak wage growth feeds through to lower costs and inflation," he predicted.
Inflationary pressures were also evident in the producer prices index, which tracks the prices charged by manufacturers.
It accelerated to a 2% annual rise in June, from 1.2% in May, according to the ONS, as the cost of oil and of foodstuffs rose sharply.
However, some analysts said they foresaw inflation dropping sooner, with June possibly representing the high point.
"The uncertainty is whether inflation will peak at its present level before falling later this year, as we expect," said David Kern, chief economist at the British Chambers of Commerce.
"If this happens, it is still possible that the recovery will continue to slowly gather momentum throughout the year and into 2014.
"However if unexpected developments, such as renewed surges in energy prices, push inflation up further, our growth prospects will face new risks."
The rise in inflation is bad news for workers, whose pay continues to be eroded by rising prices.
Average earnings excluding bonuses in the three months to April were only 0.9% higher than a year earlier - two percentage points below the rate of inflation.
"Sustained high inflation, coupled with a prolonged pay freeze then squeeze for millions of public sector workers, has hit families hard," said Dave Prentis, general secretary of the Unison union.
Price rises are also hurting savers.
To beat inflation, a basic rate taxpayer at 20% needs to find a savings account paying 3.63% per annum, according to personal finance website Moneyfacts. However, no savings account is offering such a rate at the moment.
"The effect of inflation on savings means that £10,000 invested five years' ago, allowing for average interest and tax at 20%, would have the spending power of just £8,846 today," Moneyfacts said.