The nearly two-decade-long war began in Afghanistan after the Sept. 11, 2001 attacks in the U.S.

The United States has signed a deal with the Taliban, paving the way to end a nearly two-decade-long war.

On Saturday, U.S. special envoy Zalmay Khalilzad and Taliban founder and negotiator, Mullah Abdul Ghani Barada, met in Doha, Qatar, to seal a deal which binds the U.S. to withdraw troops from Afghanistan in exchange for the Taliban to discuss peace negotiations and cutting ties from terrorist groups, according to the New York Times.

The war in Afghanistan, which lasted over 18 years, took off after the U.S. invaded the country in response to the Taliban-backed terrorist attacks on September 11, 2001.

Under the agreement, the U.S. is expected to reduce its troops down from the current 13,000 to 8,600 and to close five military bases within the next 135 days, officials said, according to ABC News.

Prisoners are also obligated to be released and by March 10, the U.S. is committed to releasing 5,000 Taliban troops while “the other side” is expected to let go of 1,000 people, the agreement stated.

U.S. soldiers board an Army Chinook
Credit: John Moore/Getty Images

However, a complete withdrawal of U.S. troops from Afghanistan — which is expected to be completed in 14 months — is contingent upon the Taliban’s full commitment to its peace negotiations.

According to NBC News, after signing the agreement, several people in the room erupted in cheers, some shouting “God is Great” and members of the Taliban were seen leaving the ceremony smiling.

“The future of Afghanistan is for Afghans to determine,” said Secretary of State Mike Pompeo, who was in Doha for the signing. “The U.S.-Taliban deal creates the conditions for Afghans to do just that.”

According to the Times, the war in Afghanistan cost nearly $2 trillion and there have been more than 3,500 American fatalities and tens of thousands of Afghani deaths.

“If the Taliban and the government of Afghanistan live up to these commitments, we will have a powerful path forward to end the war in Afghanistan and bring our troops home,” President Donald Trump said Friday, ahead of the agreement, the Times reported. “These commitments represent an important step to a lasting peace in a new Afghanistan, free from Al Qaeda, ISIS, and any other terrorist group that would seek to bring us harm.”

During a press conference to address coronavirus concerns on Saturday, Trump spoke of the long war, telling reporters at the White House: “It’s been a hard journey for everybody. … If bad things happen, we’ll go back.”