The City expected consumer prices to rise by 2.6%
UK inflation rose at its fastest annual pace for nine months in December.
The Office for National Statistics said the Consumer Price Index (CPI) measure of inflation had risen to 2.9%, up from an annual rate of 1.9% in November.
That was the biggest jump in the annual rate from one month to the next since records began, and exceeded the City's expectations of an increase to 2.6%.
The Retail Price Index (RPI), which includes housing costs, rose to 2.4%, its highest level since November 2008.
This was a rise from 0.3% in November, and also constitutes the biggest monthly rise in the annual rate of RPI inflation since 1979.
The news boosted the value of the pound, with markets betting on an early end to the Bank of England's policy of increasing the money supply under what is known as quantitative easing (QE) and possible future rises in interest rates.
The pound increased to a four-month high against the euro, adding 1.3 cents to 1.1477, making a euro worth 87 pence.
In a speech on Tuesday evening, Bank of England Governor Mervyn King warned that inflation was "likely to pick up markedly in the first half of this year".
He added that it was "likely to rise to over 3% for a while", and that it could go even higher if energy prices and indirect taxes were to increase further.
However, he said inflation "should return to target in the medium term".
The annual increase in CPI mainly came about because of a number of unusual factors that had depressed prices a year earlier. These included a near-record fall in oil prices in December 2008, the VAT cut to 15% and retail discounting, the Office for National Statistics said.
Ten out of 12 sub-sectors recorded higher prices, with the biggest increases coming from transport and clothing and footwear.
Core CPI, which excludes food, energy, tobacco and alcohol, rose by 2.8% on the year, which is the fastest pace of growth since records began in January 1997.
The RPI and CPI measure the change in prices charged for goods and services bought by households in the UK. It is based on average spending patterns for UK households.
The CPI does not take into account certain items that are included in the RPI. The Retail Price Index includes council tax, mortgage interest payments, buildings insurance and house depreciation.
Turning his attention to the wider economic recovery, Mr King said "the patience of UK households is likely to be sorely tried over the next couple of years".
"There is little scope for growth in real take-home pay, which may remain weak even as output recovers."
In regards to the continuing global economic recovery, Mr King added that the G20 group of largest world economies should take the lead in formulating new rules for the financial system.
He said countries like the US and UK had to start exporting more, while nations such as China had to boost their domestic spending.