International troops were sent to Afghanistan by the Western military alliance Nato after the Taliban were ousted in 2001 following the 9/11 attacks in the United States.
The number of Nato forces peaked at about 140,000 in 2011, but decreased in subsequent years as Nato countries wound down combat operations, handing over control to local security forces.
Countries with troops still in Afghanistan include the US, Georgia, Germany, Turkey, Romania, Italy, the UK and Australia.
How many foreign troops are in Afghanistan now?
Nato ended its combat mission in Afghanistan in December 2014, leaving a 13,000-strong residual force used for training and counter-terrorism operations, including 9,800 US troops.
The US originally planned to withdraw all but a small embassy-based force of 1,000 troops by the end of 2016.
However, due to a growing Taliban threat, US President Barack Obama has announced he will maintain troop numbers at 9,800 for most of 2016.
About 5,500 troops will still be in the country when he leaves office in 2017.
The top US commander in Afghanistan, Gen John Campbell, said last week that an enhanced military presence would be necessary if the Taliban were to be repelled.
How successful has the international mission been?
That depends on how you look at it.
On 18 June 2013, the last Afghan districts - mainly along the eastern frontier, and in Kandahar, the birthplace of the Taliban - moved formally from Nato forces to a full Afghan combat lead, a handover with great symbolic impact.
But if improving security for the average Afghan is the criterion by which success is measured, the answer is very different.
Militant violence has increased across the country following the departure of most foreign forces last year.
After more than a decade of war, the Taliban are a long way from being defeated and remain a formidable fighting force.
In recent weeks Taliban militants succeeded in briefly seizing the provincial capital of Kunduz, before eventually being repelled by Afghan forces.
It was their most significant military gain since being ousted from power in 2001.
Al-Qaeda also continues to operate in Afghanistan, while Islamic State militants have also conducted attacks in the country.
What does the Afghan government think?
The Afghan government will welcome the move to extend the US military presence.
President Ashraf Ghani's government signed a Bilateral Security Agreement (BSA) with the US in September 2014, allowing US soldiers to stay in the country to train and assist Afghanistan's security forces.
Earlier this year, Mr Ghani also said that a slower withdrawal would allow Afghan forces to be better trained and equipped.
Relations between the US and Afghanistan have significantly improved under Mr Ghani - his predecessor, Hamid Karzai, had refused to sign the BSA with the US.