Media playback is unsupported on your device Media caption The BBC's James Landale asked David Cameron why only some of the UK's troops would be returning home

UK troops could be withdrawn from Afghanistan more quickly than previously announced, David Cameron has suggested.

The prime minister announced this week that numbers would be cut from 9,000 to 5,200 next year.

But, on a pre-Christmas visit to Camp Bastion in Helmand province, he said there was "flexibility" in the plan.

There had been better-than-expected progress in training the country's own security, Mr Cameron added.

On Wednesday, the prime minister announced cuts in troop numbers serving in Afghanistan as part of the plan to end combat operations in 2014.

But he told reporters at Camp Bastion: "Of course there is always flexibility in any plan."

'Haven of terrorism'

During the visit he acknowledged that troops had paid a "high price" but said their efforts had been worthwhile.

More than 400 UK personnel have died since the operation in Afghanistan began in 2001 but the military presence has cut the number of terrorist plots, Mr Cameron said.

During his trip, he played table football and attended a carol service.

On his traditional seasonal visit to troops, Mr Cameron toured Camp Bastion and was taken by helicopter to the smaller Camp Price operating base about 20 miles (32km) away.

Image caption David Cameron plays table football with Royal Marines at Forward Operating Base Price

All Nato operations are due to finish by the end of 2014, with responsibility being transferred to Afghan forces.

Mr Cameron suggested the Afghans were acquiring the "capability" to take charge of security.

"This is withdrawal. This is drawdown based on success not on failure," he said.

"We're confident it can be done while making sure Afghanistan does not return to become a haven of terrorism, which is of course why we came here in the first place."

He added: "We have paid a very heavy price but I think the reason for coming here in the first place, which was to stop Afghanistan being a haven for terror... I think it was the right decision."

Troop numbers are already being reduced from 9,500 to 9,000 before Christmas.

A small number of British troops would remain in the country beyond that, working at an officer training academy and "involved in returning equipment and dealing with logistics", Mr Cameron told MPs at Prime Minister's Questions on Wednesday.

But during his visit to Afghanistan, government officials promised an extra £230m from Treasury reserves would be spent on military kit to see the campaign through.

The funding includes £29m for additional bomb detectors; a £10m upgrade for armed vehicles; more military dogs for foot patrols and £5m to boost intelligence, surveillance and reconnaissance at Camp Bastion.

BBC deputy political editor James Landale, travelling with the prime minister, said the aim of the visit was to give troops some sense of reassurance about their role.

Commanders do not want to leave Afghanistan before the "job is done", he added.

With the insurgency pushed out to the edges of society, and the Afghan army and police improving, there was a growing sense of optimism in the country, commanders had told him.