Afghan troops have recaptured the centre of the strategic northern city of Kunduz amid fierce clashes with Taliban militants, three days after losing the provincial capital in a humbling defeat for Kabul and its US allies.

Key points: Afghan forces reclaim control of Kunduz

Afghan forces reclaim control of Kunduz Taliban say they vacated as a tactic

Taliban say they vacated as a tactic NATO troops say they fought in self defence

NATO troops say they fought in self defence US army generals believe ground troops should stay on ground until 2016

Fighting continued in other parts of the city, the seizure of which represented a major victory for the insurgents and raised questions over whether NATO-trained Afghan forces were ready to go it alone now most foreign combat troops have left.

Residents said soldiers were conducting house-to-house searches and had removed the Taliban flag from the central square, replacing it with government colours.

"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."

Taliban spokesman Zabihullah Mujahid said fighters had withdrawn to the edges of the city in order to attempt to encircle Afghan and US forces.

"It was our tactic to vacate the city to allow enemy troops to enter so we could encircle them," he said.

US special forces accompanied and later fought alongside Afghan troops, the international military coalition confirmed, saying that they returned fire in self-defence.

The Afghan army's deputy chief of staff, Murad Ali Murad, said most Taliban fighters had fled, although some were holed up in civilians' homes.

"Our plan is to force them out of Kunduz," said Mr Murad, who flew to the city on Wednesday to personally oversee the recapture operation.

"We will take them out of districts and then out of the province."

A Ministry of Defence 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 health ministry spokesman. He also said hospitals in Kunduz had treated about 340 wounded.

Wreckage from the battle was visible outside the city airport. Afghan soldiers said a burned out Humvee was hit by a US air strike, and the bodies of half a dozen dead Taliban fighters were scattered along the road and in a nearby orchard.

Soldiers had taken photos of the dead militants and were proudly displaying them to their colleagues.

Residents in hiding amid fierce struggle

A spokesman for the NATO mission said US special forces advisers were travelling with Afghan troops on their offensive when they came under threat from the Taliban.

The Americans "returned fire in self-defence to eliminate the threat," he added.

Sorry, this video has expired What is the significance of the Taliban's takeover of Kunduz?

The spokesman confirmed that there had been five US air strikes against Taliban positions near the city and airport since fighting began on Monday "to eliminate threats to coalition and Afghan forces".

Terrified residents said there was intense fighting overnight as 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.

"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."

The Taliban, whose harsh interpretation of Islamic law during a five-year rule included public executions and denying women rights to work and education, have been fighting to regain power since being toppled by a US-led intervention in 2001.

The once-quiet north of Afghanistan has seen escalating violence in recent years as the insurgency spread, and swathes of Kunduz province have repeatedly come under siege this year.

The Afghan's forces chief executive Abdullah Abdullah said 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.

While Afghan forces celebrated on Thursday, some warned that the Taliban's retreat could be temporary, especially because the insurgents looted banks and seized military equipment during their three-day occupation.

"There are huge amounts of cash floating around, weapons and ammunition," said Ted Callahan, a Western security analyst.

"They have moved stockpiles [to outlying districts] because they knew they wouldn't hold the city for long."

Afghan security forces investigate a site where vehicles were burned during fighting. ( AFP: Wakil Kohsar )

Reuters