Battles ongoing in Baghlan province’s Puli Khumri even as US envoy says Washington and group are ‘at threshold’ of deal.

A second attack by the Taliban in as many days has left several civilians and security forces dead, officials said, as the violence overshadowed increasing expectations over a peace deal between the group and the United States aimed at ending 18 years of war.

The Afghan interior ministry on Monday said four civilians and two members of the security forces were killed in the attack the previous day on Puli Khumri, the capital of Baghlan province, with 20 civilians and two security forces wounded.

It added that 21 Taliban fighters were dead.

Provincial council member Mabobullah Ghafari said he had seen the bodies of at least six members of the security forces on Sunday and that the situation was worsening by the hour.

Gunfire could be heard late into the afternoon in parts of the city, home to more than 220,000 people. Some were trying to flee.

“I’m afraid the city will collapse if we don’t get reinforcements soon,” Ghafari said, adding that the Taliban had occupied some checkpoints with no resistance from security forces.

Taliban fighters had taken shelter in some homes, he said.

The early-morning attack came a day after hundreds of Taliban fighters overran parts of Kunduz, one of Afghanistan’s largest cities, in a major show of strength as the group wrapped up another round of peace talks with the US in Qatar.

The assault on Kunduz set off a day of gun battles, with the Afghan military deploying reinforcements and using air power to repel the fighters. On Sunday, the interior ministry said the Taliban had been cleared from Kunduz but some fighters had fled to Baghlan.

The attacks came after Zalmay Khalilzad, the US envoy heading the negotiations with the Taliban, said he raised the Kunduz attack in his talks with the group in Doha and told its representatives “violence like this must stop”.

The Taliban, which was overthrown in 2001 by a US-led military coalition, has long demanded a complete withdrawal of foreign troops to “end the occupation” in Afghanistan.

The US accused the Taliban of sheltering fighters from al-Qaeda, the group blamed for the September 11, 2001 attacks.

The Taliban attacks are seen as strengthening the Taliban’s negotiating position in the talks with Khalilzad, who, for nearly a year, has sought a deal on a US troop withdrawal in exchange for Taliban guarantees that Afghanistan will not be used as a launchpad for attacks outside the country.

Intizar Khadim, a political analyst in Kabul, told Al Jazeera, that the Taliban was taking “calculative steps”.

“The Taliban is trying to play their own brand of peace diplomacy, which means they are holding a rock in their left hand and shaking hands on the right,” he said.

“They don’t want to hold off all their power in the country and call for a ceasefire yet while the talks are ongoing.”

An agreement between the US and Taliban would not on its own end the fighting between the group and Afghan security forces, but it would set the stage for intra-Afghan peace talks.

However, it was not clear whether the Taliban would agree to talk directly with the Western-backed government of President Ashraf Ghani, which they consider an illegitimate foreign-imposed regime.

Some Taliban officials have said they would only agree to talk to Afghan officials in a private capacity, not as representatives of the state, and they remain opposed to presidential elections scheduled for September 28.

It was also unclear whether the agreement would cover the full withdrawal of all 14,500 U.S. troops from Afghanistan or how long a pullout would take.

“Peace is the only option right now on the table. There is no winner or loser in this war. If fight continues in Afghanistan, all sides will lose. If peace happens, it is a win-win situation,” Khadim said.

‘Success’

After the end of the ninth round of talks in the early hours of Sunday, Khalilzad said he was headed to Kabul to brief the Afghan government.

He said the US and the Taliban are “at the threshold of an agreement”.

Speaking to Al Jazeera, Suhail Shaheen, the Taliban’s political spokesman in Doha, said the talks between the two sides were a “success”.

“At 2pm today (Sunday), we will be talking with a small group of US officials on technical issues of the deal.”

There are some 14,000 remaining US troops in Afghanistan, where they train and support Afghan forces but also come to their aid with air raids and counterterror operations.

The approaching agreement with the Taliban “will reduce violence and open the door for Afghans to sit together to negotiate an honourable and sustainable peace and a unified, sovereign Afghanistan that does not threaten the United States, its allies, or any other country,” the Afghan-born Khalilzad said on Twitter.