Media playback is unsupported on your device
The US and the Taliban have signed an "agreement for bringing peace" to Afghanistan after more than 18 years of conflict.
The US and Nato allies have agreed to withdraw all troops within 14 months if the militants uphold the deal.
President Trump said it had been a "long and hard journey" in Afghanistan. "It's time after all these years to bring our people back home," he said.
Talks between the Afghan government and the Taliban are due to follow.
Under the agreement, the militants also agreed not to allow al-Qaeda or any other extremist group to operate in the areas they control.
Speaking at the White House, Mr Trump said the Taliban had been trying to reach an agreement with the US for a long time.
He said US troops had been killing terrorists in Afghanistan "by the thousands" and now it was "time for someone else to do that work and it will be the Taliban and it could be surrounding countries".
"I really believe the Taliban wants to do something to show we're not all wasting time," Mr Trump added. "If bad things happen, we'll go back with a force like no-one's ever seen."
Media playback is unsupported on your device
The US invaded Afghanistan weeks after the September 2001 attacks in New York by the Afghanistan-based al-Qaeda group.
More than 2,400 US troops have been killed during the conflict. About 12,000 are still stationed in the country. President Trump has promised to put an end to the conflict.
The deal was signed by US special envoy Zalmay Khalilzad and Taliban political chief Mullah Abdul Ghani Baradar with US Secretary of State Mike Pompeo as a witness.
In a speech, Mr Pompeo urged the militant group to "keep your promises to cut ties with al-Qaeda".
Mr Baradar said he hoped Afghanistan could now emerge from four decades of conflict.
"I hope that with the withdrawal of all foreign forces from Afghanistan the Afghan nation under an Islamic regime will take its relief and embark on a new prosperous life," he said.
Meanwhile US Defence Secretary Mark Esper was in the Afghan capital Kabul alongside Afghanistan's President Ashraf Ghani - whose government did not take part in the US-Taliban talks.
Mr Esper said: "This is a hopeful moment, but it is only the beginning. The road ahead will not be easy. Achieving lasting peace in Afghanistan will require patience and compromise among all parties." He said the US would continue to support the Afghan government.
Mr Ghani said the country was "looking forward to a full ceasefire". The government said it was ready to negotiate with the Taliban.
Within the first 135 days of the deal the US will reduce its forces in Afghanistan to 8,600, with allies also drawing down their forces proportionately.
The move would allow US President Donald Trump to show that he has brought troops home ahead of the US presidential election in November.
The deal also provides for a prisoner swap. Some 5,000 Taliban prisoners and 1,000 Afghan security force prisoners would be exchanged by 10 March, when talks between the Taliban and the Afghan government are due to start.
The US will also lift sanctions against the Taliban and work with the UN to lift its separate sanctions against the group.
In Kabul, activist Zahra Husseini said she feared the deal could worsen the situation for women in Afghanistan.
"I don't trust the Taliban, and remember how they suppressed women when they were ruling," the 28-year-old told AFP.
"Today is a dark day, and as I was watching the deal being signed, I had this bad feeling that it would result in their return to power rather than in peace."
This historic deal has been years in the making, as all sides kept seeking advantage on the battlefield.
The agreement is born of America's determination to bring troops home and a recognition, at least by some Taliban, that talks are the best route to return to Kabul.
It's a significant step forward, despite deep uncertainty and scepticism over where it will lead. When the only alternative is unending war, many Afghans seem ready to take this risk for peace.
Taliban leaders say they've changed since their harsh rule of the 1990s still seared in the memory of many, and most of all Afghan women.
This process will test the Taliban, but also veteran Afghan leaders of the past, and a new generation which has come of age in the last two decades and is hoping against hope for a different future.
Since 2011, Qatar has hosted Taliban leaders who have moved there to discuss peace in Afghanistan. It has been a chequered process. A Taliban office was opened in 2013, and closed the same year amid rows over flags. Other attempts at talks stalled.
In December 2018, the militants announced they would meet US officials to try to find a "roadmap to peace". But the hard-line Islamist group continued to refuse to hold official talks with the Afghan government, whom they dismissed as American "puppets".
Media playback is unsupported on your device
Following nine rounds of US-Taliban talks in Qatar, the two sides seemed close to an agreement.
Washington's top negotiator announced last September that the US would withdraw 5,400 troops from Afghanistan within 20 weeks as part of a deal agreed "in principle" with Taliban militants.
Days later, Mr Trump said the talks were "dead", after the group killed a US soldier. But within weeks the two sides resumed discussions behind the scenes.
A week ago the Taliban agreed to a "reduction of violence" - although Afghan officials say at least 22 soldiers and 14 civilians have been killed in Taliban attacks over that period.
Media playback is unsupported on your device
It began when the US launched air strikes one month following the 11 September 2001 attacks and after the Taliban had refused to hand over the man behind them, Osama bin Laden.
Media playback is unsupported on your device
The US was joined by an international coalition and the Taliban were quickly removed from power. However, they turned into an insurgent force and continued deadly attacks, destabilising subsequent Afghan governments.
The international coalition ended its combat mission in 2014, staying only to train Afghan forces. But the US continued its own, scaled-back combat operation, including air strikes.
The Taliban has however continued to gain momentum and in 2018 the BBC found they were active across 70% of Afghanistan.
Media playback is unsupported on your device
Nearly 3,500 members of the international coalition forces have died in Afghanistan since the 2001 invasion.
The figures for Afghan civilians, militants and government forces are more difficult to quantify. In a February 2019 report, the UN said that more than 32,000 civilians had died. The Watson Institute at Brown University says 58,000 security personnel and 42,000 opposition combatants have been killed.
There are many reasons for this. But they include a combination of fierce Taliban resistance, the limitations of Afghan forces and governance, and other countries' reluctance to keep their troops for longer in Afghanistan.
At times over the past 18 years, the Taliban have been on the back foot. In late 2009, US President Barack Obama announced a troop "surge" that saw the number of American soldiers in Afghanistan top 100,000.
Media playback is unsupported on your device
The surge helped drive the Taliban out of parts of southern Afghanistan, but it was never destined to last for years.
The BBC World Service's Dawood Azami says there are five main reasons the war is still going on now. They include:
There's also the role played by Afghanistan's neighbour, Pakistan.
There's no question the Taliban have their roots in Pakistan, and that they were able to regroup there during the US invasion. But Pakistan has denied helping or protecting them - even as the US demanded it do more to fight militants.
More:
Afghan conflict: US and Taliban sign deal to end 18-year war - BBC News
- NATO Protesters Receive 5- To 8-Year Prison Terms [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- NATO - Wikipedia, the free encyclopedia [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- Latvia: US troops arrive in Baltics for NATO drill - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- No NATO. May 2012. Archive. Chicago, Il - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- Erkkio Tuomioja: "Nato suojaa Suomea meteoriiteilta". - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- US troops arrive in Latvia for NATO exercises: Baltic states concerned by Russian military threat - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- Voglio andare a vivere a Laveno dove e' nato Pozzetto - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- OcaqTv - Rusiya NATO srhdini pozdu -- F-16-lar havaya qalxd - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- Men of War Assault Squad Cold War Mod - NATO vs Warsaw Pact - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- US troops in Poland: American soldiers arrive for NATO exercises in response to Russia threat - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- Ancona 23-04-14 PdCI - La crisi dell'Ucraina, la NATO e l'UE: pericoli di guerra e lotta x la Pace - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- Eastermonday Peace ralley NATO Bchel germany 21.04.2014 - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- How to change Gear 2 Strap NATO no tool needed - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- In Context: The War Report #3 - Ukraine and NATO - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- On The Wrist Omega Speedmaster Black NATO Strap - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- US, NATO expanding on Russia doorstep: Analyst - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- NATO War Games Send Warning to Moscow - Video [Last Updated On: April 26th, 2014] [Originally Added On: April 26th, 2014]
- NATO to deploy recon flights over Poland [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- Nato News [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- NATO - State [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- NATO: Definition from Answers.com - Answers - The Most ... [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- Marine Le Pen: Vyvediem Franczsko z NATO - francztina, rutina - Video [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- 5 NATO troops killed in Kandahar Afghanistan UK's helicopter crash - Video [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- European observers detained in Ukraine are branded 'Nato spies' - Video [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- Prostittas priecjas par NATO karavriem Latvij - Video [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- MV Bill - A Luz #PersianaBaixaMix (prod. DJ Nato pk) Part. @KmillaCdd - Video [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- Furious Russia Proposes Retaliation Against NATO Countries! - Video [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- Conversation: NATO's Evolving Mission - Video [Last Updated On: April 27th, 2014] [Originally Added On: April 27th, 2014]
- NATO supply trucks stuck in Pakistan - Video [Last Updated On: April 28th, 2014] [Originally Added On: April 28th, 2014]
- NATO troops killed in Afghanistan helicopter crash - Video [Last Updated On: April 28th, 2014] [Originally Added On: April 28th, 2014]
- Slovakia: NATO exercises in Central Europe - Video [Last Updated On: April 28th, 2014] [Originally Added On: April 28th, 2014]
- "NATO 3" individuals sentenced - Video [Last Updated On: April 28th, 2014] [Originally Added On: April 28th, 2014]
- NATO exercise scenario: Naval response to invasion of allied country [Last Updated On: April 29th, 2014] [Originally Added On: April 29th, 2014]
- NATO News and Video - FOX News Topics - FOXNews.com [Last Updated On: April 29th, 2014] [Originally Added On: April 29th, 2014]
- RAF Typhoons Arrive in Lithuania to Reinforce NATO Air Policing Mission - Video [Last Updated On: April 29th, 2014] [Originally Added On: April 29th, 2014]
- Poland: French Rafale fighter jets join NATO force - Video [Last Updated On: April 29th, 2014] [Originally Added On: April 29th, 2014]
- RAF Deploys Typhoon Jets To Bolster Nato Air Policing Mission - Video [Last Updated On: April 29th, 2014] [Originally Added On: April 29th, 2014]
- Sunday 4/27/2014 - Tarpley Points Out Fake-OSCE Observers Are Actually NATO Military Officers - Video [Last Updated On: April 29th, 2014] [Originally Added On: April 29th, 2014]
- Germany: Pro-Russians rally against NATO in Frankfurt - Video [Last Updated On: April 29th, 2014] [Originally Added On: April 29th, 2014]
- April 28 2014 Breaking News NATO minesweepers set off on Baltic deployment - Video [Last Updated On: April 30th, 2014] [Originally Added On: April 30th, 2014]
- NATO forces serve world bankers: Analyst - Video [Last Updated On: April 30th, 2014] [Originally Added On: April 30th, 2014]
- 2 NATO troops killed in attack in eastern Afghanistan - Video [Last Updated On: April 30th, 2014] [Originally Added On: April 30th, 2014]
- STEFANO BORGONOVO:ATTACCANTE NATO IL DOCUMENTARIO - Video [Last Updated On: April 30th, 2014] [Originally Added On: April 30th, 2014]
- RAF Deploys Typhoon Jets To Bolster NATO Air Policing Mission [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO opens second Baltic air base in Estonia with 4 Danish fighter jets amid Ukraine crisis [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO triples fighter jets in Baltic countries - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Lithuania: US hands over NATO air patrol to UK - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Ukraine: Kerry announces more support from NATO towards coup - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Scoring Political Points? NATO bolsters forces in Eastern Europe - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Putin: NATO Chief Rasmussen secretly taped, leaked meeting when he was Danish PM - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Russia Accuses NATO of 'Provocative' Actions - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO & its future NAZI headquarters - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO Fest 2014 - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- RAF Jets Respond To Ukraine Crisis 28.04.14 - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- OSCE team in Ukraine NATO spies: Analyst - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO commander: Europe concept on international borders changed after Crimea annexation [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO allies take over Baltic mission from Air Force [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO official says Russia must now be viewed as more of an enemy than a partner [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO official says Russia now an adversary [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- North Atlantic Treaty Organization - The New York Times [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Estonian Air Base Turns Into Second NATO Baltic States Hub - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Finale Ligure Freeride H e Base nato con Patrik - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Ellodesse Mv.1, 2, 3 - nato in Synthesia - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO Boosts Presence in Eastern Europe Amid Continued Turmoil in Ukraine - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO's efforts to attain advancement in ariel warfare and defense HD Stock Footage - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Me Gusta By Nato 2014 - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- Toward a Europe Whole and Free: Secretary of State John Kerry - Video [Last Updated On: May 1st, 2014] [Originally Added On: May 1st, 2014]
- NATO official: Russian moves in Ukraine pose 'grave challenge' to global security system [Last Updated On: May 2nd, 2014] [Originally Added On: May 2nd, 2014]
- As NATO Builds It's Forces The Economy Is On The Brink Of Collapse -- Episode 355 - Video [Last Updated On: May 2nd, 2014] [Originally Added On: May 2nd, 2014]
- 15 years on: NATO's Murino Massacre of innocent children remembered In the NOW. - Video [Last Updated On: May 2nd, 2014] [Originally Added On: May 2nd, 2014]
- Nato -- finally finding its feet? - Video [Last Updated On: May 2nd, 2014] [Originally Added On: May 2nd, 2014]
- Europe Responds to Russian Aggression: NATO opens second Baltic hub at Estonia's Amari air base - Video [Last Updated On: May 2nd, 2014] [Originally Added On: May 2nd, 2014]
- NATO air strength triples in Baltic states - Video [Last Updated On: May 2nd, 2014] [Originally Added On: May 2nd, 2014]
- Russia now an adversary, NATO official says [Last Updated On: May 3rd, 2014] [Originally Added On: May 3rd, 2014]
- NATO Movie - Video [Last Updated On: May 3rd, 2014] [Originally Added On: May 3rd, 2014]
- The Expandables: NATO talking heads, war tech on 'crusade control' - Video [Last Updated On: May 3rd, 2014] [Originally Added On: May 3rd, 2014]
- Friend to Foe? NATO's Deputy Head classifies Russia as enemy over Ukrainian crisis - Video [Last Updated On: May 3rd, 2014] [Originally Added On: May 3rd, 2014]
- Tiger's Eye Dance by Oasis Dancers at 2014 NATO - JVC Version - Video [Last Updated On: May 3rd, 2014] [Originally Added On: May 3rd, 2014]
- Cleopatra's Dance by Oasis Dancers at 2014 NATO - JVC Version - Video [Last Updated On: May 3rd, 2014] [Originally Added On: May 3rd, 2014]
- Slave To The Rhythm Dance by Oasis Dancer at 2014 NATO - JVC Version - Video [Last Updated On: May 3rd, 2014] [Originally Added On: May 3rd, 2014]