ISLAMABAD - The United States and the Taliban signed a landmark agreement Saturday in Doha, Qatar, setting the stage for ending a nearly 19-year-old war in Afghanistan and bringing back home thousands of American troops deployed there.

U.S. chief negotiator Zalmay Khalilzad and Mullah Abdul Ghani Baradar, the Taliban deputy chief for political affairs, inked the pact at a ceremony at a hotel in the Qatari capital where Secretary of State Mike Pompeo and the foreign ministers of a number of countries were in attendance.

In a statement issued after the deal with the Taliban was signed, the White House noted President Donald Trump is making good on his promise to bring U.S. troops home from endless wars overseas by working toward peace in Afghanistan.

"An agreement has been reached with the Taliban that secures important commitments that are necessary to finally end the conflict in Afghanistan. While work remains, this progress provides a historic opportunity for peace,” the statement reads.

U.S. Secretary of State Mike Pompeo speaks at a signing ceremony of the U.S.-Taliban agreement in the Qatari capital Doha, Feb. 29, 2020.

Under the agreement, Washington and its allies are committed to immediately begin withdrawal of all military forces from Afghanistan within 14 months from five bases there in return for guarantees Afghan soil will not harbor transnational terrorist groups.

Within the first 135 days, the number of American forces would be brought down to 8,600 from roughly 13,000 currently stationed in the country.

The Taliban also is committed to engage in peace negotiations with Afghan stakeholders on a permanent cease-fire and power-sharing in post-war Afghanistan. The intra-Afghan talks are supposed to begin within 10 days. In the days leading up to the those negotiations, the Afghan government is to release 5,000 Taliban prisoners while the insurgents have to free around 1,000 detainees from its custody.

"This agreement will mean nothing and today’s good feelings will not last if we don’t take concrete action on commitments and promises that have been made,” Pompeo told the signing ceremony in Doha.

He stressed that ultimately it will be up to Afghans to determine their future through intra-Afghan talks. “The U.S.-Taliban deal creates the conditions for Afghans to do just that.”

The reclusive Taliban chief, Haibatullah Akhundzada, who allegedly is living in Pakistan, urged his fighters to honor the peace, declaring it a victory for the insurgent group.

Text: Agreement for Bringing Peace to Afghanistan

"This victory is the collective victory of the entire Muslim and Mujahid nation … The accord about the complete withdrawal of all foreign forces from Afghanistan … is undoubtedly a great achievement,” Akhundzada asserted in a statement released to media.

Pompeo in his speech to the signing ceremony said that “there will be a temptation to declare victory," but he stressed that victory for Afghans will be achieved only when they can live in peace and prosper.

The secretary acknowledged, however, the intra-Afghan dialogue process would be challenging in terms of achieving its objective.

Defense Secretary Mark Esper also has issued a joint declaration with the government of Afghanistan, reassuring the turmoil-hit nation that the U.S.-led partners will remain committed to the peace process.

NATO Secretary General Jens Stoltenberg, Afghan opposition presidential candidate Abdullah Abdullah, Afghan President Ashraf Ghani, and U.S. Secretary of Defense Mark Esper pose for a photo at the presidential palace in Kabul, Feb. 29, 2020.

Esper told a news conference Saturday during his visit to Kabul that a lack of commitment on the part of the Taliban could force Washington to pull out of the agreement. He said the U.S. will closely watch the Taliban’s actions in terms of further reducing insurgent violence and showing progress in intra-Afghan negotiations to demonstrate their efforts toward peace are being made in good faith. “

Should the Taliban fail to honor their commitments, they will forfeit their chance to sit with fellow Afghans and deliberate on the future of their country. Moreover, the United States would not hesitate to nullify the agreement,” Esper warned.

Afghan President Ashraf Ghani, while speaking along with Esper and NATO Secretary General Jens Stoltenberg, said his government is ready to engage with the Taliban on a wider agenda to promote peace in the country.

"They should be ready to discuss their relationship with their state and non-state sponsors, a verifiable system for cutting off their ties with all transnational terrorist groups, their dependence and involvement narcotics and other transnational criminal organizations positively,” Ghani said.

The Taliban has consistently refused to engage in peace talks with Ghani and his government, however, dismissing it as an American puppet. The insurgent group says, though, it would not oppose participation of government officials in their individual capacity in intra-Afghan talks with an inclusive delegation comprising representatives of other Afghan political, as well as civil society, groups.

A reduction of violence agreement between the U.S. and Taliban went into effect seven days ago, and its success paved the way for Saturday's signing.

FILE - Former Afghan President Hamid Karzai speaks during an interview in Kabul, Afghanistan, Sept. 24, 2019.

Former Afghan president Hamid Karzai told VOA's Afghan service, “We are very happy to see the signing taking place on Saturday. It’s a welcomed thing. And from that point on, we hope that the intra-Afghan dialogue will start as soon as possible so Afghans can sit together and bringing lasting peace to our beloved country.”

The head of strategic relations at Afghanistan's Ministry of Peace Affairs, Najiyah Anwari, said, “The delegation of the Islamic Republic of Afghanistan government will be inclusive ... in a way that it is able to represent Afghanistan well and to keep the achievements of Afghan people and their demands in the past two decades and fight for it.”

U.S. involvement in Afghanistan, which started nearly 19 years ago, after the September 11, 2001, attacks on the United States, has cost Washington almost $1 trillion and the lives of about American 2,400 military personnel.