Taliban fighters advanced deep into the last holdout province of Panjshir on September 5, as the top US general warned Afghanistan faces a wider civil war that would offer fertile ground for a resurgence of terrorism.

Following their lightning-fast rout of Afghanistan’s army last month – and celebrations on August 30 when the last US troops flew out after 20 years of war – the Taliban are seeking to crush resistance forces defending the mountainous Panjshir Valley.

The Taliban are yet to finalise their new regime after rolling into Kabul three weeks ago at a speed that analysts say likely surprised even the hardline Islamists themselves.

But top US General Mark Milley questioned whether they can consolidate power as they seek to shift from a guerrilla force to a government.

“I think there’s at least a very good probability of a broader civil war,” said Milley, chairman of the Joint Chiefs of Staff, in a bleak assessment.

“That will then in turn lead to conditions that could, in fact, lead to a reconstitution of al-Qaeda or a growth of Isis [the Islamic State group],” he told Fox News on September 4.

Afghanistan’s new rulers have promised a more “inclusive” government that represents the country’s complex ethnic makeup – though women are unlikely to be included at the top levels.

However, this time women will be allowed to attend university as long as classes are segregated by sex or at least divided by a curtain, the Taliban’s education authority said in a lengthy document issued on September 5.

Female students must also wear an “abaya” (robe) and “niqab” (face-veil), as opposed to the even more conservative burqa mandatory under the previous Taliban regime.

Few in Panjshir, a rugged valley north of Kabul that held out for nearly a decade against the Soviet Union’s 1979-1989 intervention and also the Taliban’s first rule from 1996-2001, seem to trust their promises.

Taliban official Bilal Karimi on September 5 reported heavy clashes in Panjshir, and while resistance fighters insist they have the Islamists at bay, analysts warned that they are struggling.

The Italian aid agency Emergency said Taliban forces had reached the Panjshir village of Anabah, where they run a surgical centre.

Anabah lies some 25km north inside the 115km-long valley, but unconfirmed reports suggested the Taliban had seized other areas too. Both sides claim to have inflicted heavy losses on the other.

The US spent billions supplying the Afghan military with the tools to defeat the Taliban, a sizeable portion of which fell into the militants’ hands after the US withdrawal and collapse of the army.

Former vice-president Amrullah Saleh, who is holed out in Panjshir alongside Ahmad Massoud – the son of legendary anti-Taliban commander Ahmad Shah Massoud – warned of a grim situation.

Saleh in a statement spoke of a “large-scale humanitarian crisis”, with thousands “displaced by the Taliban onslaught”.

The Panjshir Valley, surrounded by jagged snow-capped peaks, offers a natural defensive advantage, with fighters melting away in the face of advancing forces, then launching ambushes firing from the high tops down into the valley.

The international community is coming to terms with the new Taliban regime with a flurry of diplomacy.

UN secretary-general Antonio Guterres has called for an end to the violence over fears of a new civil war.

He urged all parties “to exercise utmost restraint to protect lives and to ensure that humanitarian needs can be met”, in a report to the Security Council obtained by AFP but not yet released publicly.

The UN’s humanitarian chief Martin Griffiths was in Kabul on September 5 for several days of meetings with Taliban leadership, with a UN spokesman saying the group committed to cooperating with the humanitarian community.

“The authorities pledged that the safety and security of humanitarian staff, and humanitarian access to people in need, will be guaranteed and that humanitarian workers – both men and women – will be guaranteed freedom of movement,” Stephane Dujarric said.