David Cameron has reaffirmed plans to withdraw British troops from Afghanistan amid fresh warnings the country could re-emerge as a terrorist haven once international forces have gone.
Attending the Nato summit in Chicago, the prime minister confirmed British troops - like other international forces - will end their combat role by the end of 2014.
"That is our deadline," he said.
Despite the international pull-out, he insisted the Taliban could not regain power by force of arms and he urged them to re-open negotiations with the government of President Hamid Karzai, the Press Association reported.
"The message to the insurgency is equally clear: you can't win on the battlefield; stop fighting and start talking," he said.
However senior officials acknowledged there was no guarantee that terrorists would not be able to re-establish a foothold in the country from which Osama bin Laden launched the 9/11 attacks.
"It is unrealistic to assume that Afghanistan is going to be completely secure and there is no possibility of a terrorist threat reemerging," said one official.
"But our achievements of the last decade mean that we will withdraw from a country where the threat is much reduced and where Afghan forces are now much more able to respond to that threat."
Officials have already raised the prospect that a small number of British troops - almost certainly special forces - could stay on in a counter-terrorism role after 2014.
Previously ministers have said any remaining British troops would be involved solely in the training and mentoring of the Afghan National Security Forces.
Meanwhile the commander of the international military force, US General John Allen, warned they would face combat fighting right up until the last day of their mission.
"There is no end of combat before the end of 2014. And in fact, the Taliban will oppose the ANSF after 2014," he said.
He said that even after the ANSF take the lead for security across the country from the middle of next year, there would still be a significant combat role for international forces.
"We envisage that the ANSF will move into the lead - this milestone 2013 - for the prosecution of counterinsurgency, and we'll largely be in support of that," he said.
"But it doesn't mean that we won't be fighting and it doesn't mean there won't be combat."
Mr Cameron said it was in Britain's national interest to continue supporting Afghanistan beyond 2014.
"It is in our national interest that we continue to play an important role in supporting Afghanistan beyond 2014," he said.
"We are making a decisive and enduring commitment to the long-term future of Afghanistan.
"The message to the Afghan people is that we will not desert them."
Britain has already pledged $110 million a year (£70m) towards the £4 billion annual cost of supporting the Afghan forces after 2014.
The Americans, who will shoulder the lion's share of the burden, are looking for around $1.3 billion (£820m) from the allies and were said to be confident of achieving the total.
There were fresh contributions totalling almost $1 billion (£630m) during the summit from the Netherlands, Denmark and Luxembourg, with further support expected from the Gulf states.
Mr Cameron acknowledged there would be a "better outcome" if efforts to build up the Afghan security forces were accompanied by political development and progress.
"That is not fully in our control," he said.
"But I am confident that our troops can leave with their heads held high having completed the combat task in 2014, because they will be handing over to fully capable Afghan National Security Forces who will be able to deal with any residual problems and issues."
He expressed frustration that president Barack Obama had been unable win agreement from Pakistani president Asif Ali Zardari to reopen supply routes into Afghanistan closed after a US drone strike killed 24 Pakistani soldiers.
He nevertheless expressed confidence that the dispute would eventually be resolved.
"We have to understand the difficult politics and political situation in Pakistan. In spite of the occasional frustrations we have to stick with that relationship and I believe it will deliver."
he engines of the SpaceX Falcon 9 light but fail to launch from the Cape Canaveral Air Force Station on May 19, 2012 in Titusville, Florida. The launch in the early hours of Saturday morning would have made SpaceX the first commercial company to send a spacecraft to the International Space Station. (Photo by Roberto Gonzalez/Getty Images)
Chelsea Pensioners open the Westland Magical Tower Garden, a 24 meter high seven-tiered garden display, at the RHS Chelsea Flower Show, in Chelsea, west London.(PA)
will.i.am passes the Olympic Flame to torchbearer Emma Folwer in Taunton, Somerset.(PA)
The Prince of Wales watches as the Duchess of Cornwall tastes a sponge cake at the St-Francis School in Saint John eastern Canada, on the second day of a four day Diamond Jubilee tour of the north American country.(PA)
Visitors wait in front of the entrance of the Tokyo Skytree in Tokyo, Tuesday, May 22, 2012. The world's tallest tower and Japan's biggest new landmark opened to the public on Tuesday. (AP Photo/Itsuo Inouye)
Workers put finishing touches on the carving wax featuring Lord Buddha during the preparation to celebrate the 2,600 years of Buddhism in Bangkok, Thailand Tuesday, May 22, 2012. (AP Photo/Apichart Weerawong)
An aerial view of the Mosquitia region near the remote community of Ahuas, Honduras, Monday, May 21, 2012. On Friday May 11, a joint Honduran-U.S. drug raid, on a helicopter mission with advisers from the DEA, appears to have mistakenly targeted civilians in the remote jungle area, killing four riverboat passengers and injuring four others. Later, according to villagers, Honduran police narcotics forces and men speaking English spent hours searching the small town of Ahuas for a suspected drug trafficker.(AP Photo/Rodrigo Abd)
Niagara Falls emergency officials rescue a man who plunged over Niagara Falls and survived in an apparent suicide attempt, Monday, May 21, 2012. The man is only the third person known to have gone over without a safety device and live. A waiting helicopter flew him to Hamilton General Hospital, where a spokeswoman says he has critical but non-life-threatening injuries. (AP Photo/Harry Rossetani)
An Iraqi man rides his donkey cart in a Baghdad street, in a yellow haze from a heavy dust storm which shut the capital's airport on May 22, 2012. AFP PHOTO/SABAH ARAR (Photo credit should read SABAH ARAR/AFP/GettyImages)