VICE News is covering the ongoing fight for the future of Afghanistan. Click here for more from the Enduring Freedom blog.
Afghan troops recaptured the centre of the strategic northern city of Kunduz on Thursday after fierce clashes with Taliban militants, three days after losing the provincial capital in a humbling defeat for Kabul and its US allies.
Residents said soldiers were conducting house-to-house searches and had removed the Taliban flag from the central square, replacing it with government colors.
But fighting continued on the outskirts of the city, whose capture represented a major victory for the insurgents and raised questions over whether NATO-trained Afghan forces were ready to go it alone now that most foreign combat troops have left.
"There are military helicopters in the sky and government forces everywhere," said Abdul Ahad, a doctor in the city. "Dead Taliban are on the streets, but there are still [militants] in some government buildings fighting Afghan forces."
A Taliban spokesman denied the government had retaken all of Kunduz and said insurgent fighters had withdrawn to the edges of the city to avoid being encircled by Afghan and US forces.
Dawlat Waziri, spokesman for the Ministry of Defense, said the Taliban had left Kunduz city and a clearance operation was underway. A ministry statement said 150 Taliban had been killed and 90 wounded in the overnight offensive.
At least 30 people, mostly civilians, had been killed in the fighting as of Wednesday, according to a tweet from health ministry spokesman Wahidullah Mayar. He also said hospitals in Kunduz had treated about 340 injured.
Terrified residents said there was heavy fighting overnight as the Afghan forces moved in. "There were very heavy air strikes during the night. Those strikes prompted the Taliban to escape," Kunduz resident Abdul Qadir Anwari said on Thursday morning.
"Right now Afghan security forces are on the streets and fighting with the Taliban in some areas outside the city. Shops are still closed and people aren't leaving their houses."
Taliban spokesman Zabihullah Mujahid said fighting continued on Thursday. "It was our tactic to vacate the city to allow enemy troops enter so we could encircle them," he said.
A spokesman for the Western coalition did not comment directly on what role its troops played in the overnight offensive, if any, saying that they were "involved in Kunduz" in an advisory role.
"Our service members retain the right to protect themselves, if necessary, while performing their advise-and-assist mission," spokesman Col. Brian Tribus added.
On Wednesday, a group of coalition special forces, including US troops, engaged the Taliban in a ground clash, Tribus had said earlier.
He confirmed there had been five US air strikes against Taliban positions near the city and airport since fighting broke out on Monday "to eliminate threats to coalition and Afghan forces."
The Taliban, who ruled Afghanistan with a harsh interpretation of Islamic law for five years, have been fighting to re-establish their Islamist rule after being toppled from power by a US-led intervention in 2001.
The once-quiet north of Afghanistan has seen escalating violence in recent years as the insurgency sought to gain territory, and swathes of Kunduz province have repeatedly come under siege this year.
Yet the Taliban's pre-dawn assault on Kunduz on Monday caught the Afghan police and army by surprise, handing the group arguably its largest victory in 14 years of war.
The three days it took to bring a major city back under government control may have political consequences for President Ashraf Ghani, whose first year in office has been clouded by infighting and escalating violence around the country.
Hundreds of angry Afghans, waving placards and banners, marched in central Kabul on Thursday to protest against the Taliban and government officials they accuse of being sympathetic to the militants.
The city's capture by the Taliban was a blow to the narrative that the NATO-trained Afghan police and army were steadily improving and able to prevent the Taliban from taking over and holding significant territory.
Training the 350,000-strong Afghan National Security Forces has been the heart of the US plan to end involvement in its longest war. NATO forces officially wound up their combat role last year, leaving behind a training and advising force of several thousand.
Chief Executive Abdullah Abdullah told Reuters on Wednesday that the crisis in Kunduz demonstrated the need for foreign troops to stay in the country.
"As far as I understand, the view of all those (US) Army generals and officers on the ground… in Afghanistan, as well as our own security and military leadership, is that maintaining a level of force beyond 2016 is necessary," he said in New York.