David Cameron has insisted that UK combat troops will be out of Afghanistan by 2015.
The prime minister told the Nato summit in Lisbon, where the 28 leaders agreed a strategy to transfer military control to Afghanistan by 2014, that the UK deadline was "firm".
He said Afghan forces would begin taking charge of security next year.
Shadow foreign secretary Yvette Cooper said Labour "strongly supported the Afghan forces taking the lead in 2014".
Mr Cameron said the handover would be complete by the end of 2014, allowing British troops to leave combat roles by 2015.
"The commitment we have entered into to transfer the lead responsibility for security to the Afghan government by the end of 2014 will pave the way for British combat troops to be out of Afghanistan by 2015," he said.
"This is a firm deadline which we will meet."
He said the UK was the second-biggest contributor of troops and by 2015 they will have spent nine years in Helmand, the "toughest part of Afghanistan".
"We've already paid a very high price, we go on paying that price," he said.
"We know we have an important role in bringing the stability and security that is good for the whole of the world and good for Britain because we still face an Islamic terrorist threat that comes out of the Afghanistan-Pakistan region."
He said Britain would continue to have a relationship with Afghanistan after 2015, through aid and training of Afghan troops.
He added it was "only right" the government was clear with the British public, who deserved to know there was an end-point to the conflict.
His comments came after Afghan President Hamid Karzai and Nato Secretary General Anders Fogh Rasmussen endorsed a plan to hand over control of security by 2014, while retaining a long-term commitment to the country.
However, Mr Rasmussen said: "We will not transition until our Afghan partners are ready.
"If the enemies of Afghanistan have the idea that they can wait it out until we leave, they have the wrong idea. We will stay as long as it takes to finish our job."
The prime minister dismissed suggestions of a contradiction in strategies.
"I don't accept there is a difference because Nato is saying that between early 2011 and 2014 transition will take place and by 2014 what you will have is the Afghans in lead security control throughout Afghanistan," he said.
"When I set this deadline I set it beyond that mark."
Asked whether he would pull British troops out while US forces went on fighting, Mr Cameron said: "We are working extremely closely with our closest ally and we will go on doing that.
"But as I've said I couldn't be more clear about what 2015 is and what it means."
Shadow defence secretary Jim Murphy said now Nato had set a deadline of 2014, there must be a "plan for progress to improve conditions on the ground".
"Nato must set out detailed plans to train and develop Afghan security forces as it is they who will have responsibility for the country when we leave," he said.
Ms Cooper, shadow foreign secretary, added: "We will be pressing the UK government to ensure British troops who remain in Afghanistan in a training role have the right security conditions to do their job."
There are about 9,500 UK servicemen and women in Afghanistan, with the majority deployed in the south.
The death of Guardsman Christopher Davies on Wednesday brought the total of UK servicemen and women killed in Afghanistan since 2001 to 345.
Thousands of anti-war demonstrators took to the streets of London on Saturday, calling for the end to the war.