Q&A: Foreign forces in Afghanistan
International troops were sent to Afghanistan after the Taliban were ousted in 2001 following the 9/11 attacks in the United States. Most foreign forces are scheduled to leave by the end of next year.
There are still questions over how many foreign soldiers will remain after the 2014 deadline - some special forces will stay to conduct "counter-terror operations" and others to support and train Afghan forces.
Nato has spent the past two years handing over security control - starting with Bamiyan in the summer of 2011 - and all areas had been transferred to Afghan forces by mid-2013.
On 18 June the last districts, mainly along the eastern frontier, and in Kandahar, the birthplace of the Taliban, moved formally to full Afghan combat lead, completing the transition process. Correspondents said the practical effect of the handover was not great - but the symbolic impact profound.How many Nato troops are there?
As of early June there were just under 100,000 Nato troops serving in Afghanistan from 50 contributing nations, the International Security and Assistance Force (Isaf) said.
Of these the bulk - about 68,000 - are US troops.
The number of US forces in Afghanistan peaked at about 101,000 in 2011, taking full Nato force numbers to about 140,000. But an extra 33,000 American soldiers sent as part of the "surge" have now been withdrawn and Washington plans to carry on winding down combat operations during 2013.
About half the current remaining number of troops - 34,000 - will return to the US by early 2014.
Leaders of nations contributing forces in Afghanistan have been talking about withdrawal for some time. Both France and Canada ended their combat missions early, although they have yet to bring all their troops home.
Britain, the second largest contributor to Nato's Afghanistan operation, has about 8,000 troops in Afghanistan, with 3,000 more due to be brought home over the summer. Most of the remainder will leave by the end of 2014.
Australia has said most of its troops most will be home by the end of 2013 and that it will close its Tarin Kot base in Uruzgan province by the end of the year. Other contributing countries include Germany, Italy, Australia, Poland and Turkey.How successful has the mission been?
That depends on how you look at it.
One stated goal has been to prevent Afghanistan from being a "safe haven" from which al-Qaeda might plan attacks in other countries.
Most analysts agree that, by that yardstick, the Nato operation has in part been successful. Al-Qaeda's strength in the country has been reduced, although it still has a presence in the country.
But if improving security for the average Afghan is the criterion by which success is measured, the answer is very different. Civilian casualties have risen steeply in recent years - although they fell in 2012. It remains to be seen if that trend is sustained long-term - the first half of 2013 showed a rise of 24% compared with 2012.
After more than a decade of war, the Taliban are a long way from being defeated and have been growing in strength. Many of Nato's territorial gains are by no means irreversible and the militants still have the capacity to launch devastating surprise attacks such as the September 2012 attack on Camp Bastion.
If the troop surge of 2010 was successful in stopping the Taliban's momentum in the south, it did not succeed in defeating the militants, especially in the north and centre where the alliance is thinner on the ground.
Insurgents have exacted a heavy toll - since 2001 more than 3,000 coalition troops have been killed in Afghanistan.
The pressure on Nato leaders to pull troops out has also been exacerbated by a series of "green-on-blue" attacks in which members of the Afghan security forces have turned their arms on coalition troops. At least 60 Nato personnel were killed in such attacks in 2012 - many more Afghan security force members have died at the hands of their colleagues, in so-called "green-on-green" attacks.How ready are Afghan forces?
A cornerstone of Nato strategy has been to boost the size and effectiveness of Afghan security forces ahead of the Nato pullout. The ANA currently has about 185,000 trained members.
There are similar numbers of Afghan police, who are less well trained.
Whether army and police numbers are scaled back after 2014 when Western financial support shrinks has still to be decided.
The government says the response of the Afghan security forces to recent Taliban attacks in Kabul and this one in April 2012 clearly show how much more professional they have become.
Afghan forces remain inconsistent, but those who train them say the best are as good as any army in a developing country.
But many people still question how the army would fare against the insurgents without help from Nato. Only time will tell.How strong are the Taliban?
The Taliban and their allies have returned with a vengeance after their rout in December 2001.
The militants are thought to be only about 20,000 strong.
But it has become increasingly clear to Nato that it cannot win militarily against the insurgents, and many areas of the country are under their de facto control. Despite their strength it is far from certain, however, that they would have the power to retake Kabul, once Nato leaves.
The militants have been taking part in renewed peace efforts and there was a flurry of diplomatic activity at the end of 2012, raising hopes of a possible settlement.
Pakistan, Afghanistan's powerful neighbour, also released a number of Taliban prisoners, who observers say it had been holding as bargaining chips in the "Afghan endgame".Do Afghans support the foreign presence?
Afghans have become increasingly angry at civilians being killed by foreign forces, in night raids, aerial bombardments and other attacks. Nato's failure to do better on this score is seen as a key factor in why support for its mission has fallen.
Relations between President Karzai and the US in particular have been strained by the killing of 15 Afghan civilians by an American soldier in March 2012, violent protests over the inadvertent burning of copies of the Koran at a US airbase in February 2012 and the emergence of a video in January of the same year which appeared to show US troops urinating on Taliban bodies.
However, many Afghans also say they fear the Taliban may return once foreign troops pull out.
Despite all this, Afghans remain optimistic about the state of their country, repeated polls commissioned by the BBC, ABC News and German broadcaster ARD have shown.