The United States is committed to withdrawing foreign forces from Afghanistan to end more than 17 years of war, a senior US government official said on Monday, speaking after six days of American peace talks with Afghan Taliban militants.

The official, speaking on condition of anonymity, described "significant progress" in talks last week with the Taliban in Qatar about a foreign troop pullout, but more negotiations were needed on a ceasefire and its timing.

"Of course we don't seek a permanent military presence in Afghanistan," the official said in the capital Kabul.

"Our goal is to help bring peace in Afghanistan and we would like a future partnership, newly defined with a post-peace government," the official told Reuters. "We would like to leave a good legacy."

There could not be a withdrawal without a ceasefire, the official said. The issue looms as a sticking point in the next round of talks on February 25, with the US official saying Taliban negotiators wanted a full withdrawal before a ceasefire.

US special peace envoy Zalmay Khalilzad told the New York Times on Monday a draft framework had been completed but details still needed to be worked out.

"We have a draft of the framework that has to be fleshed out before it becomes an agreement," Khalilzad told the Times in an interview in Kabul. "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."

US forces in 2001 toppled Afghanistan's Taliban leaders who had harboured al Qaeda militants responsible for the September 11 attacks on the United States that killed about 3,000 people.

Read more:
How will the withdrawal of US troops affect Afghanistan?
US set to pull 7,000 troops from Afghanistan
Top US commander in Afghanistan says no orders to pull out

Acting US Defence Secretary Patrick Shanahan said on Monday he was encouraged by US peace talks with Taliban insurgents but added he had not yet been asked to plan for a full withdrawal of troops from the more than 17-year-old war.

"It's encouraging," Shanahan, who said he had been briefed on the talks, told reporters outside the Pentagon before meeting NATO Secretary General Jens Stoltenberg.

Asked whether he had been tasked with planning a complete withdrawal from Afghanistan, Shanahan said: "I have not."

Despite the presence of US-led foreign forces training, advising and assisting their Afghan counterparts, the Taliban control nearly half of Afghanistan and stage near-daily attacks against the Western-backed Afghan government and its security forces.

Afghan President Ashraf Ghani said last week that 45,000 members of the country's security forces had been killed since he took office in 2014.

Trump is planning to withdraw more than 5,000 of the 14,000 US troops in Afghanistan, a US official said in December, in the latest sign that the US president's patience is thinning with America's longest war and overseas military interventions. Trump last month rebuffed top advisers and decided to pull US troops out of Syria as well.

Core concerns

Both US officials and the hardline Islamic group hailed progress after the talks on Saturday with Khalilzad. Taliban sources told Reuters on Saturday that the United States had agreed on the withdrawal of foreign troops within 18 months of the signing of a pact but the US official said a timeline was not discussed.

The 14,000 US troops in Afghanistan are part of a NATO-led mission and a US counter-terrorism mission largely directed at groups such as Islamic State and al Qaeda.

Some 8,000 troops from 38 other countries are participating in the operation, known as Resolute Support.

The US official said progress was made on addressing core US concerns that Afghanistan will not be used as a base by al Qaeda or Islamic State for attacks against the United States and its allies.

"That is why we came to Afghanistan in the first place," the official said.

Apart from the ceasefire, the Taliban did not discuss the need for talks with the Afghan government to reach a durable political settlement, the US official said.

Taliban officials have repeatedly refused to talk to the Afghan government, which they regard as a US puppet, throwing into question how effective a peace deal could really be. The Taliban does want, however, to join an interim government post-deal, something that alarms Ghani.

Khalilzad, an Afghan-born American diplomat, met Ghani for four hours on Sunday to outline progress and seek his support.

Ghani said in a televised address that the presence of foreign forces was based on an international agreement and they will not be required forever.

"No Afghans want foreign forces in their country for the long term," Ghani said. "The current presence of foreign forces is based on need ... and according to an exact and arranged plan we are trying to bring down that number to zero."