In the fall of 2010, U.S. officials secretly met a young Taliban representative outside the southern German city of Munich.
Tayyib Agha, a member of the militant group's political wing, presented the U.S. diplomats with a road map for a negotiated end to the war.
It was not the United States' first contact with the Taliban.
Since the U.S.-led invasion toppled the Taliban regime in 2001, the militant group had sought a channel with Washington. There had been contact between U.S. and Taliban military commanders. But the 2010 meeting, brokered by Germany, was a turning point in the conflict.
'For the first time, both the Taliban and the United States had some degree of seriousness in seeking talks towards a political settlement,' Jarrett Blanc, a former diplomat who was involved in former President Barack Obama administration's negotiations with the Taliban, tells RFE/RL. 'Even then, people knew enough to know that we weren't going to 'win the war.''
But in the intervening years, meaningful U.S.-Taliban talks failed to take off, hampered by mutual mistrust, missed opportunities, protests by the Afghan government, and the deaths of two successive Taliban leaders.
Now, nearly a decade since those initial secret contacts, the United States and the Taliban are apparently on the verge of agreeing to a landmark peace deal that would end the United States' longest-ever war.
A U.S.-Taliban deal would see the withdrawal of at least some foreign troops from Afghanistan in return for Taliban guarantees that the country would not become a haven for terrorist groups. That agreement would commit the militants to launch separate negotiations with the Western-backed Kabul government over a political settlement and a permanent cease-fire.
Afghan security forces arrive after a powerful explosion outside the provincial police headquarters in Kandahar Province last month. Talks have not led to any drop in Taliban attacks.
For years, U.S. policy was to facilitate an Afghan-led, Afghan-owned peace process between the Kabul government and the Taliban. But with the Taliban refusing to negotiate with state officials -- who they view as illegitimate -- the peace process was deadlocked.
'I believe we made a mistake for all those years in not agreeing to a phased process whereby the U.S. and the Taliban would talk through our issues first,' says Blanc, who from 2009-15 was first a senior adviser to U.S. special representative for Afghanistan and Pakistan Richard Holbrooke and later the deputy and then the acting special representative.
'Eventually there needed to be an intra-Afghan deal, but there was also a conflict between the U.S. and the Taliban that needed to be addressed,' Blanc adds. 'We couldn't outsource that to the Afghan government and the Taliban wouldn't accept that in any case because they didn't think the Afghan government spoke for our military forces.'
U.S. policy changed when Zalmay Khalilzad was appointed as special envoy for peace and he opened direct negotiations with the Taliban in Qatar without the presence of the Afghan government.
The Afghan government has protested and vented its anger at being sidelined from the U.S.-Taliban negotiations. But significantly, Khalilzad has said that even if the United States and the Taliban come to an agreement, the deal will not be implemented until there is also a permanent cease-fire and intra-Afghan negotiations.
'Nothing is agreed until everything is agreed,' Khalilzad has said.
The eighth round of U.S.-Taliban talks ended on August 12, with both sides hammering out the technical details and the implementation mechanisms of the potential agreement.
The broad outlines of the agreement have been widely reported in U.S. media. They include the phased withdrawal of all foreign troops, likely within two years; no immediate cease-fire but a cessation of violence in regions as foreign troops begin pulling out of them, so that a de facto cease-fire broadens along with the progress of the withdrawal; and the Taliban preventing terrorist groups from using Afghanistan as a springboard for attacks.
Preparations are also under way in the Norwegian capital, Oslo, where Khalilzad visited last week, for the launch of intra-Afghan negotiations.
Pakistani Prime Minister Imran Khan (right) meets with U.S. envoy Zalmay Khalilzad in Islamabad on August 1.
A draft of the agreement is also reported to include a U.S. pledge to release 13,000 Taliban prisoners within three months of the announcement of the U.S.-Taliban deal and a reference to a 'post-peace Islamic government' that has raised fears in Kabul that an agreement will eliminate Afghanistan's republican system of government. There is also no reported mention of the September 28 presidential election, with many Afghans believing that the vote may be postponed or scrapped altogether.
In Afghanistan, there is a fear that the United States is making too many concessions to the Taliban and, in its rush for an exit, Washington could sign a withdrawal agreement, not a peace deal.
'There's very much a risk of a peace deal that doesn't bring peace,' Blanc says. 'It depends on how well the United States plays its hand and uses its substantial remaining leverage provided by the continued U.S. troop presence. It also depends on how well Afghan parties, including the Afghan government, play their hand in intra-Afghan negotiations.'
Javid Ahmad, a senior fellow at the Washington-based Atlantic Council, says the United States needs to address several key 'flaws' in the potential agreement.
This includes the United States conditioning its final withdrawal date on full and verifiable implementation of the intra-Afghan deal, he says, adding that the absence of a small, enduring U.S. military presence raised concerns over how the overall agreement will be implemented.
He also says Washington needs to 'exercise caution' while releasing the 13,000 Taliban prisoners to ensure that those freed do not join extremist groups like the Islamic State.
'Too much focus has been placed on securing a deal [on] paper and less so on the implementation,' Ahmad says. 'For now, the United States, it seems, is concerned about the former while the Afghan government is worried about the latter.'
Copyright (c) 2018. RFE/RL, Inc. Republished with the permission of Radio Free Europe/Radio Liberty, 1201 Connecticut Ave NW, Ste 400, Washington DC 20036