Image copyright Getty Images Image caption The conflict in Afghanistan is America's longest-ever war

US and Taliban negotiators have agreed on a draft framework for a peace deal seeking to put an end to the 17-year conflict in Afghanistan, Washington's top negotiator has said.

US negotiators held six days of talks with the Taliban in Qatar last week.

The Afghan president has made a new call for direct talks with the Islamist group, but they have so far refused, dismissing the government as "puppets".

The group ruled the country from 1996-2001 and remain a top insurgent force.

Their rule ended when the US invaded Afghanistan after al-Qaeda - which had used the country as a base - carried out the 9/11 attacks in the US.

Analysts say it could be years before a substantive peace deal is reached.

Zalmay Khalilzad, the US Special Representative for Afghanistan Reconciliation, was in Kabul to brief the Afghan government about the talks.

Media playback is unsupported on your device Media caption Auliya Atrafi went to Helmand Province where the Taliban are most active

"We have a draft of the framework that has to be fleshed out before it becomes an agreement," he told The New York Times in an interview, adding that as part of the proposed deal the Taliban would vow to prevent Afghanistan being used as a hub for terrorism.

The Trump administration's strategy has been to put pressure on the Taliban to negotiate with the Afghan government.

It is exploring a full withdrawal of US troops - in return for a ceasefire and a commitment by the Taliban to these direct talks.

The Taliban say they will only begin negotiations with the government once a firm date for troop withdrawal has been agreed.

The 17-year conflict has caused huge loss of life. According to UN figures, between 6,000 and 11,000 civilians have been killed every year since 2009.

What was said at the talks?

In the New York Times interview, Mr Khalilzad said the Taliban had pledged not to give terrorist groups like al-Qaeda safe haven - a key demand from Washington if it pulls out troops.

"The Taliban have committed, to our satisfaction, to do what is necessary that would prevent Afghanistan from ever becoming a platform for international terrorist groups or individuals," he said.

Image copyright Reuters Image caption Mr Khalilzad (back left) briefed President Ghani (centre) on Sunday

Until the interview, the US envoy had only released a series of tweets about the talks - saying "significant progress" had been made but without providing details.

The discussions clearly remain at a provisional stage - and a long way from agreement on the broader issues required for lasting peace in Afghanistan - but after years of stalemate, it's welcome progress, says the BBC's South Asia editor Jill McGivering.

A senior Taliban official who attended the talks told the BBC over the weekend that both sides had agreed to form two committees to draw up detailed plans on how to implement agreements in principle on two key issues:

When will American-led forces be withdrawn from Afghanistan?

A commitment from the Taliban that the group will not allow international jihadist groups like al-Qaeda to use the country as a base in the future

The Taliban official, speaking on condition of anonymity, said the committees would "identify routes for the withdrawal, and how much time is needed. We suggested six months, but are flexible".

Progress, but where next?

By Jonathan Marcus, BBC Defence and Diplomatic correspondent

It is often said that there is no military solution for the US and its allies in Afghanistan. The US approach is largely to convince the Taliban that they cannot win either.

But is this strategy succeeding? At one level the progress in the current talks would suggest it is. But the reality is that the Taliban are speaking from a position of relative strength.

Losses amongst the Afghan security forces are dramatic. The government only controls or influences territory containing some two-thirds of the population.

Nobody imagines that the Afghan military can be self-supporting any time soon.

Accurate metrics of the true security situation are hard to find. A huge amount of spin comes from US military sources. Now President Trump is signalling that he wants some, and eventually all, US troops out. But the strategy underpinning US withdrawal remains both uncertain and unclear.

What does the government say?

On Monday, Afghan President Ashraf Ghani issued a fresh plea to the Taliban to talk directly to his government.

He alluded to fears that freedoms could be lost if the Taliban were to share power. Women's rights activists have expressed particular concern due to the militants' brutal treatment of women when they ran the country.

"We are committed to ensuring peace," he said. "But there are values which are non-negotiable, for example national unity, national sovereignty, territorial integrity, a powerful and competent central government and basic rights of the citizens of the country."

According to Mr Ghani's office, in a meeting on Sunday, Mr Khalilzad denied that there had been any discussions with the Taliban about future governance arrangements in Kabul.

What is the current situation in Afghanistan?

The Taliban's power and reach have surged since foreign combat troops left Afghanistan in 2014.

Thousands of Nato-led troops remain in training, support and counter-terrorism roles.

The US has the largest contingent, with 14,000. US President Donald Trump is reportedly considering withdrawing half of these.

About 8,000 from another 38 countries are also present.

On Friday, Mr Ghani said more than 45,000 members of the country's security forces had been killed since he became leader in 2014.

It is estimated that about 15 million people - half the Afghan population - are living in areas either controlled by the Taliban or where the militants are openly present and regularly mount attacks.