Media playback is unsupported on your device Media caption The United States and the Taliban mark the signing of their agreement in Doha.

US, Afghan and Taliban officials have all been careful to avoid calling Saturday's agreement in Doha "a peace deal." But in Afghanistan, a sense of cautious optimism has been rising ever since a week long "reduction in violence" or partial truce leading to the signing came into effect.

How did we get here? And why did it take so long?

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

There seems to have been a growing realisation, both amongst the group's leadership and in the US that neither side is capable of an outright military victory. President Trump, meanwhile, has been clear about his desire to withdraw American troops from the country.

One key concession by the US, which allowed negotiations to take place, was the decision in 2018 to change its longstanding policy that the Taliban should talk first of all to the Afghan government, who the insurgents dismiss as illegitimate.

Instead the US sat down directly with the Taliban to address their chief public demand - the presence of foreign forces in Afghanistan. Those negotiations led to Saturday's accord, with the Taliban agreeing in exchange to address the core reason for the US invasion in 2001, the group's links to al-Qaeda.

Image copyright AFP Image caption Taliban political chief Mullah Abdul Ghani Baradar (c) signed the deal

This deal now opens the door to separate, wider talks between the militants and other Afghan political leaders - including government figures.

Those discussions will be much more challenging. Somehow there will have to be a reconciliation between the Taliban's vision of an "Islamic Emirate" and the democratic modern Afghanistan that has been created since 2001.

Where does that leave women's rights? What is the Taliban's stance on democracy? These are questions that will only be answered when the "intra-Afghan talks" begin.

Media playback is unsupported on your device Media caption The view from Lashkar Gah province on whether peace with the Taliban is possible

Up until now, the Taliban have been, perhaps deliberately, vague. There are possible obstacles even before those talks begin. The Taliban want 5,000 of their prisoners released before they start. The Afghan government wants to use those detainees as a bargaining chip in the talks to persuade the Taliban to agree to a ceasefire.

Then there's the ongoing political dispute over the results of the presidential election - with Ashraf Ghani's rival Abdullah Abdullah alleging fraud. A backdrop of political instability could make it harder to establish the "inclusive" negotiating team international observers want to see sitting across the table from the Taliban.

Image copyright Reuters Image caption It is not yet clear how many US troops will stay on if peace falters

One Afghan official admitted to me that even when they start, the "intra-Afghan" negotiations could take years. But the US has signalled its intent to withdraw all its forces within 14 months if the Taliban fulfil their side of the agreement.

It is not immediately clear if that means the US will stay on beyond that time, if no settlement has been reached.

Afghan officials have emphasised the pullout is "conditional", but one diplomat told me withdrawal was only contingent on the "intra-Afghan talks" starting, not concluding. He expressed concern that if the US were to pull forces out and the Taliban decided to up the ante on the battlefield, Afghan forces would be left extremely vulnerable.

Media playback is unsupported on your device Media caption The BBC was given exclusive access to spend a week with ambulance workers in Afghanistan

Other analysts have warned that the Taliban doesn't appear to be in the mood for concessions, presenting the agreement today to their supporters as a "victory". The Taliban do however appear to want international legitimacy and recognition. The fanfare around the ceremony in Doha has given them that, and they may feel negotiations offer the best chance of achieving their aims.

The priority for many ordinary Afghans, at least in the short term, is a substantive reduction in violence. We'll find out in the coming weeks, when the warmer spring weather generally heralds the start of "fighting season", if that will happen.