Attending the opening day of the Nato summit in Chicago, the Prime Minister said "one way or the other" the majority of British troops would be home by the end of 2014.
Earlier however, a senior official disclosed that a "small number" of British troops - most probably special forces - could remain in a counter-terrorism role.
It is the first time anyone in government has raised the prospect of any form of combat role for British troops after 2014, ministers having previously said any remaining troops would simply be there to train and mentor the Afghan forces.
Mr Cameron stressed that he remained confident the Afghan forces would be able to prevent a return of al Qaida to the country, having made "huge progress" in the past two years.
"We have to remember why we're in Afghanistan. We're there to stop it becoming a haven for terrorist training camps," he said. "I'm very confident that one way or the other our troops will come home and Afghanistan will be looked after by Afghan security forces who will be capable of maintaining security in their country and, crucially for us, stopping it from being a terrorist training haven that can affect us at home in terms of terrorist attacks."
After new French President Francois Hollande confirmed French troops would be ending combat operations this year - in line with his election pledge - Nato Secretary General Anders Fogh Rasmussen insisted the alliance was not abandoning Afghanistan.
"There will be no rush for the exits. Our goal, our strategy, our timetable remain unchanged," he said.
The Taliban, however, issued a statement urging other alliance member to follow the French example and pull out their forces. "We call upon all the other Nato member countries to avoid working for the political interests of American officials and answer the call of your own people by immediately removing all your troops from Afghanistan," he said.
Much of the discussion in Chicago will centre on how the Afghans manage after 2014. After surging to a maximum strength of 350,000 police and troops, the Afghan national security forces are due to fall back to around 230,000.
but private contractors will be there for years to come
- Related topics
- Last post