Washington (AFP) - The United States is optimistic about reaching a peace accord with the Taliban, but it still faces security challenges and the risk of militant threats based in Afghanistan, analysts say.
From the withdrawal of US troops to the disarming of insurgents, the path to peace after more than 18 years of war is strewn with difficulties.
The Taliban controlled the country when Al-Qaeda, based in the southern city of Kandahar, attacked the United States on September 11, 2001.
Another major attack on US interests by militants based in Afghanistan would be a major blow to US efforts to present its longest war as an overall victory.
President Donald Trump appears to be sharply aware of the risks, branding Afghanistan as "the Harvard of terrorists."
He has vowed to leave a strong US intelligence presence in the country to thwart attempts to use it again as a base for staging global attacks.
Under questioning by lawmakers Wednesday, General Mark Milley, the chairman of the Joint Chiefs of Staff, acknowledged the risks even as he expressed support for a peace accord.
"I support signing a peace agreement with the Taliban, fully recognizing what the Taliban is all about," he said, adding sardonically, "I would not support sharing intelligence with them."
The accord with the Taliban, which will be signed Saturday in Doha, commits Washington to withdraw part of the 12,000 to 13,000 US troops by the end of the summer.
Initially, 8,600 will remain, and any further withdrawal will be linked to inter-Afghan political progress.
Military sources point to last year's pull-out of US troops from Syria as a model.
But a US withdrawal from Afghanistan would be a larger undertaking, and the military sources say it has to be gradual and discreet to protect forces on the ground.
The goal is to avoid making the remaining US military personnel a target for the Taliban or jihadists from Al-Qaeda or the Islamic State group, according to the military sources, who spoke on condition of anonymity.
But the situation could unravel if US forces withdraw before a political accord between the Taliban and the Afghan government is in place, warned Carter Malkasian, a former adviser to the Joint Chiefs of Staff.
- Trusting the Taliban -
"Once we leave, the Taliban could judge that the balance of forces has changed and that they now want to renege on the agreement," he warned during a recent conference at the Council on Foreign Relations.
Since the accord is based on Taliban security guarantees, the insurgents will have to keep their forces under control, added Michele Flournoy, a former under secretary of defense for policy.
There is always "the potential for spoilers on the Taliban side," she said.
The Soviet Union's humiliating withdrawal from Afghanistan in 1989 after 10 years of war underlines the historical dangers for the United States.
A further present-day complication is that the Afghan administration is in disarray, with President Ashraf Ghani declaring himself the winner of a new term in elections but his chief rival rejecting the results and vowing to form his own government.
The biggest challenge will be reintegrating Taliban fighters, many of whom have only ever known war, into Afghan society.
A lasting peace deal will "require that they amalgamate Taliban with the Afghan armed forces," James Dobbins, a former Afghanistan advisor in the Bush and Obama administrations, told AFP. "Those are not simple things to do."
In a recent report, the Special Inspector General for Afghanistan Reconstruction (SIGAR), John Sopko, stressed that reintegration of fighters "is a complex, long-term process, as old as war itself."
He warned that the US must fund a massive a reconstruction program in Afghanistan or 60,000 Taliban fighters "expecting a peace dividend, may return to violent and predatory behavior."