The Afghan flag on Wazir Akbar Khan hill top in Kabul. (AFP)

Taliban and US negotiators have wrapped up their latest round of talks for a deal that would see America shrink its troop presence in Afghanistan, both sides said Monday.

The foes have been negotiating in Doha over the past year for a pact that would see the Pentagon begin to withdraw its 14,000 troops from Afghanistan.

Speculation has reached fever pitch in Kabul in recent days that an announcement about a deal may be imminent, but tweets from the Taliban and Zalmay Khalilzad -- the US special envoy leading the talks -- suggest work remains to be done.

"We've concluded this round of talks that started Aug 3 between the US and the Taliban. Over the last few days, the two sides focused on technical details. They were productive. I am on my way back to DC to consult on next steps," Khalilzad wrote.

Taliban spokesman Zabihullah Mujahid said the talks had stretched past midnight.

"Work was tedious & effective. Both sides agreed to consult their respective leaderships for next steps," he wrote on Twitter.

On Sunday, Khalilzad tweeted: "I hope this is the last Eid where Afghanistan is at war," referring to the holiday currently being observed across the Muslim world.

Washington is keen to end its 18-year involvement in Afghanistan, where it has spent more than $1 trillion, and President Donald Trump has said he wants troops out.

In return, the Taliban would commit to various security guarantees, including that the Islamist hardliners who long harboured Al-Qaeda would not allow Afghanistan to become a jihadist safe haven.

A US-Taliban agreement would not in itself bring Afghanistan's war to an end, as the insurgents would still need to make a deal with the Kabul government.

Many Afghans had been hoping for a ceasefire to be announced over Eid. This has not happened, but recent days have been relatively calm.

On Monday, Afghanistan's intelligence service announced 35 Taliban prisoners would be released "as a gesture of goodwill".

"The release of these prisoners is a clear sign of the strong will of the government for peace and end to war," the agency said in a statement.

The Taliban and Afghan security forces periodically release enemy prisoners.