US officials and Taliban representatives have signed a final peace deal after months of negotiations in Qatar’s capital to end the United States’s longest war, fought in Afghanistan since 2001.

Saturday’s agreement, signed in Doha in the presence of leaders from Pakistan, Qatar, Turkey India, Indonesia, Uzbekistan and Tajikistan, will pave the way for the United States to gradually withdraw its troops.

The two sides have long wrangled over the US demand for a ceasefire before the final peace agreement was signed.

Earlier on Saturday, the Taliban ordered all its fighters to halt fighting and “refrain from attacks”.

Mohammed Naeem, a Taliban representative in Doha, described the deal as “a step forward”. “With this deal comes the end of war in Afghanistan,” he added.

In a statement, the Taliban said it had reached an agreement “about the termination of occupation of Afghanistan”.

“The accord about the complete withdrawal of all foreign forces from Afghanistan and never intervening in its affairs in the future is undoubtedly a great achievement,” it added.

For his part, US Secretary of State Mike Pompeo called on the Taliban Saturday to honour its commitments.

“I know there will be a temptation to declare victory, but victory for Afghans will only be achieved when they can live in peace and prosper,” he said at the Doha ceremony

Troop withdrawal

Minutes before the deal was signed, a joint statement released by the US and the Afghan government said the US and NATO troops would withdraw from Afghanistan within 14 months.

About 14,000 US troops and approximately 17,000 troops from 39 NATO allies and partner countries are stationed in Afghanistan in a non-combatant role.

“The United States will reduce the number of US military forces in Afghanistan to 8,600 and implement other commitments in the US-Taliban agreement within 135 days of the announcement of this joint declaration and the US-Taliban agreement,” the joint statement said.

It added that the Afghan government will engage with the United Nations Security Council “to remove Taliban members from sanctions list by May 29”.

The peace deal also proposes an intra-Afghan dialogue with the government in Kabul and the release of 5,000 Taliban members from prison.

Taliban has so far refused to speak to the Western-backed Afghan government, saying it is a “puppet regime”.

The intra-Afghan talks are to begin on March 10 but no specific details have been given.

A weeklong “reduction in violence” between the Taliban, the US and Afghan security forces saw a sudden drop in violence and casualties across the country after taking effect on February 22.