Afghans should not misconstrue America's sudden and contentious withdrawal from parts of Syria as a precursor to a similar move in Afghanistan, US Defense Secretary Mark Esper said Monday.

The Pentagon chief also hinted that some sort of residual US force might remain in Syria to protect oil fields, but stressed no decision had been taken.

The US last week announced the withdrawal of 1,000 American troops from northeast Syria, days after Turkey launched an offensive against the previously US-backed Kurdish People's Protection Units (YPG), which Ankara considers a terrorist group.

The move provoked outrage from observers and even members of President Donald Trump's Republican Party, who saw the sudden withdrawal as a betrayal of the same Kurdish fighters the US had been training and arming for years to fight Islamic State jihadists in Syria.

Speaking at NATO's Resolute Support mission headquarters in Kabul, Esper said America maintains a "longstanding commitment" to Afghanistan, which it invaded in 2001 to oust the Taliban, and noted US policy direction for the country is completely different.

"All these things should reassure our Afghan allies and others that they should not misinterpret our actions in the recent week or so with regard to Syria and contrast that with Afghanistan," he said.

Underscoring America's will to stay in Afghanistan, Esper said, was that it still faces a "virulent terrorist threat that originated in the form of Al-Qaeda and now finds itself in the Taliban and ISIS-K and other groups".

ISIS-K is the abbreviation for the Afghan Islamic State affiliate.

The US and the Taliban were last month on the brink of signing a deal that would have seen some American forces begin to withdraw from Afghanistan in return for various insurgent security commitments.

An Afghan National Security Forces soldier mans a machinegun mounted on a vehicle while patrolling in Guzara, Herat province
An Afghan National Security Forces soldier mans a machinegun mounted on a vehicle while patrolling in Guzara, Herat province AFP / HOSHANG HASHIMI

But negotiations collapsed at the last minute when Trump declared talks "dead" following Taliban attacks including one that killed a US soldier.

Guarding Syria oil fields

On Syria, Esper said the withdrawal of US forces would take "weeks not days", and raised the possibility that some troops would stay for now in towns near oil fields as a way of preventing IS and other groups seizing them.

"We have troops in towns in northeast Syria that are located next to the oil fields. The troops in those towns are not in the present phase of withdrawal," Esper said.

"I've made no decision with regard to various options. Those are things that we would have to present to the president in due course".

General Scott Miller, who leads US and NATO forces in Afghanistan, said over the past year the US has reduced its military footprint across the war-torn country by about 2,000 troops.

"As we work in Afghanistan with our partners, we are always looking to optimise the force," Miller said, speaking at the same press conference as Esper.

"Unbeknownst to the public, as part of our optimisation over the last year we have reduced our authorised strength by 2,000 here."

That force reduction is unrelated to any prospective deal with the Taliban.

US Forces-Afghanistan spokesman Colonel Sonny Leggett said the US now has around 13,000 troops in the country.

Zalmay Khalilzad, the US special envoy leading negotiations, has spoken informally with Taliban officials in Pakistan, raising the possibility that Washington is seeking to resume talks, and Esper has said he supports a political agreement.