Ashraf Ghani, the Afghan president, has rejected a Taliban demand for the release of 5,000 prisoners as a condition for talks with the Afghan government and civilians.

His remarks come against the backdrop of the difficulties US negotiators face in shepherding the Afghan government and Taliban towards intra-Afghan negotiations, according to western diplomats.

“The government of Afghanistan has made no commitment to free 5,000 Taliban prisoners,” Mr Ghani said on Sunday, the day after a US-Taliban deal was signed in Qatar to start a political settlement aimed at ending America’s longest war.

The accord said the US and the Taliban were committed to work quickly to release combat and political prisoners as a confidence-building measure, with the coordination and approval of all relevant sides.

It said that up to 5,000 jailed Taliban members would be released in exchange for up to 1,000 Afghan government captives by 10 March.

Afghanistan conflict: When War Comes Home – photo exhibition Show all 10 1 /10 Afghanistan conflict: When War Comes Home – photo exhibition Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home Walas Bibi, 10 (left), was wounded in her arm and stomach by two bullets during a shoot-out between the army and the Taliban. Zubaida, 8 (right), was wounded in her legs by shrapnel from a bomb as she went to fetch water Giulio Piscitelli Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home Jawidullah Muhamad Khan, 12, from Ghazni, wounded during a bombing near his home as he came back from school with some friends. He lost four fingers and was injured in his leg in multiple places during the raid, which hit everyone in the area Giulio Piscitelli Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home Ambulance transport for two young wounded men Giulio Piscitelli Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home Noorahad, 12, from the Marjah area, hit by a bullet while he was simply sleeping in his bed at home Giulio Piscitelli Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home Anahita, 18, hit by a bullet while her husband was cleaning his gun. She risked losing her right leg, as her thigh bone was broken Giulio Piscitelli Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home A rehabilitation session for Mujahid, 10, wounded in a shoot-out between the Taliban and Afghan army near his home in the Nad Ali area Giulio Piscitelli Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home Mafton, 5, wounded in a clash between the Afghan army and Taliban militias in Tagab district, in Kapisa province. When a rocket exploded, he lost his left eye and his chest was wounded all over Giulio Piscitelli Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home A father speaks with first aid staff looking after his son, wounded by an explosive device Giulio Piscitelli Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home Nurses in Kabul take care of Somaya, 1, who had surgery on her right foot, wounded by shrapnel from an explosive device Giulio Piscitelli Afghanistan conflict: When War Comes Home – photo exhibition Zakhem | Wounds: When War Comes Home A patient left wounded by the explosion of a car bomb is treated in Kabul Giulio Piscitelli

However, on the issue of the prisoner swap, Mr Ghani said: “It is not in the authority of United States to decide, they are only a facilitator.”

Saturday’s accord was signed by US special envoy Zalmay Khalilzad and Taliban political chief Mullah Abdul Ghani Baradar, witnessed by Mike Pompeo, the US secretary of state.

After the ceremony, Mr Baradar met foreign ministers from Norway, Turkey and Uzbekistan in Doha along with diplomats from Russia, Indonesia and neighbouring nations, the Taliban said, a move that signalled the group’s determination to secure international legitimacy.

“The dignitaries who met Mullah Baradar expressed their commitments towards Afghanistan’s reconstruction and development ... the US-Taliban agreement is historical,” said Taliban spokesperson Zabiullah Mujahid.

Donald Trump, the US president, rejected criticism around the deal and said he would meet Taliban leaders in the near future.

Mr Ghani’s aides said Mr Trump’s decision to meet the Taliban could pose a challenge to the government at a time when the US troop withdrawal becomes imminent.

Under the agreement, Washington is committed to reducing the number of its troops in Afghanistan to 8,600 from 13,000 within 135 days of signing.

It will also work with allies to proportionally reduce the number of coalition forces in Afghanistan over that period.

A full withdrawal of all US and coalition forces would occur within 14 months, the joint statement said.

The withdrawal, however, depends on security guarantees by the Taliban, who ruled Afghanistan from 1996 to 2001 and imposed many restrictions on women and activities it deemed “un-Islamic”.

After being ousted from power in 2001, the Taliban has led a violent insurgency.

The Afghan war has been a stalemate for more than 18 years, with the Taliban increasingly controlling or contesting more territory, yet unable to capture and hold major urban centres.