City of London analysts had pencilled in a rise to 3.1 per cent, which would have compelled the Governor of the Bank to write a public letter to the Chancellor explaining why inflation was more than 1 percentage point above the official 2 per cent target.
Core inflation, which strips out volatile food end energy prices, was also steady at 2.7 per cent, equal to the previous month.
The Bank of England raised interest rates for the first time in a decade earlier this month - from 0.25 per cent to 0.5 per cent - in order to stop inflation getting out of hand over the coming years.
The pound dipped to $1.3091 in the immediate wake of the release, down 0.18 per cent on the day.
The Bank of England had signalled after its rate rise on 2 November that it expected inflation to rise above 3 per cent this year.
It also suggested it would have to raise rates twice more by the second half of 2020, but sterling actually fell on the day of the decision, suggesting some scepticism among traders over whether the Bank would be able to follow through on this monetary tightening cycle given the weakness of the economy and the potential disruption of Brexit.
Inflation has been driven to a five-year high this year mainly due to the impact of the slump in sterling in the immediate wake of the Brexit vote in June 2016. This has pushed up import prices, which have been passed on to consumers in the form of higher prices in the shops and for services.
The ONS reported that there was upward pressure on the annual October inflation rate from recreation, health and food, but that these had been offset by downward pressure from furniture and transport.
Some analysts argued that inflation had already peaked.
"Over coming months, we expect headline CPI to trend lower, reaching the 2.3/2.4 per cent area by Easter time," said James Smith of ING.
"As the currency effect starts to peter out, the question is whether domestically-generated price pressures start to take over."
"Retailers have nearly finished passing on higher import prices to consumers, and domestically-generated inflation still looks weak," said Samuel Tombs of Pantheon.
"As a result, we still expect CPI inflation to fall steadily to 2 per cent by the end of 2018, undershooting the [Bank of England's] expectations and enabling it to wait another 12 months before raising Bank Rate again.
More about: #pound