Afghanistan on Tuesday massed troops for a counter-offensive to take back Kunduz, a day after Taliban insurgents overran the strategic northern city in their biggest victory since being ousted from power in 2001.
Afghan security forces have retreated to the outlying airport, leaving the Taliban effectively in control of Kunduz after they stormed the city on Monday, capturing government buildings and freeing hundreds of prisoners.
The stunning fall of the provincial capital, which has sent panicked residents fleeing, has dealt a major blow to Afghanistan's NATO-trained security forces and spotlighted the insurgency's potential to expand beyond its rural strongholds.
"New forces have arrived in Kunduz... A big operation is due to start," interior ministry spokesman Sediq Sediqqi told AFP.
"The city will be taken back."
Deputy Interior Minister Ayoub Salangi said security forces were ready to retake the city and vowed to investigate how the Taliban managed to seize a major urban centre for the first time in 14 years.
Taliban spokesman Zabihullah Mujahid posted a triumphant picture on Twitter purportedly showing fighters raising the group's trademark white flag at a roundabout in the city centre.
Marauding insurgents stormed the local jail, freeing hundreds of prisoners including some Taliban commanders, officials said.
Kunduz was swarming with Taliban fighters racing stolen police vehicles, who officials said overran the governor's compound and the police headquarters.
The office of the National Directorate of Security, the country's main intelligence agency, was set on fire and a 200-bed government hospital was also captured.
Scores of unidentified bodies littered the streets after hours of heavy fighting, said local residents, many of whom were making a hasty exit from Kunduz -- some by road, as others headed to the airport.
The Taliban's incursion into Kunduz, barely nine months after the NATO combat mission concluded, raises troubling questions over the capacity of Afghan forces as they battle militants largely on their own.
The fall of the city coincides with the first anniversary of President Ashraf Ghani's national unity government coming to power, as it struggles to rein in the ascendant insurgency.
It will undoubtedly boost the image of new Taliban leader Mullah Akhtar Mansour within insurgent ranks as he seeks to draw attention away from internal rifts over his leadership.
Kunduz province, which borders Tajikistan and is a major transport hub for the north of the country, could offer the Taliban a critical new base of operations beyond their traditional southern strongholds.
In a statement late Monday, Mansour congratulated his cadres over the "major victory".
"We attacked the city of Kunduz from all sides and it is in our control," a prominent Taliban commander told AFP on condition of anonymity.
"In the long run, we may not be able to retain control but this victory will dispel the Afghan government's belief that we are only strong in areas bordering Pakistan."
Kunduz was the last Taliban stronghold in northern Afghanistan in November 2001.
"As fighting rages in Kunduz, all sides must ensure that civilians and civilian objects are protected according to international humanitarian law," Amnesty International said in a statement.
The Islamist group has been largely absent from cities since being driven from power by the US and its allies, but has maintained often-brutal rule over swathes of the countryside.
The Taliban stepped up attacks during a summer offensive launched in late April against the Western-backed government in Kabul.
On Sunday 13 people were killed and 33 wounded at a volleyball match in the eastern province of Paktika.
The Taliban denied being behind the attack in Paktika, a volatile frontier region considered a stronghold of their allies the Haqqani network.
Meanwhile, Afghanistan's thinly spread security forces are increasingly also having to deal with the threat from the self-styled Islamic State group, which is looking to make inroads in the troubled country.
It launched coordinated weekend attacks on police checkpoints in the eastern province of Nangarhar, killing at least three officers.
The two groups -- both with blood-curdling brands of Islamic fundamentalism -- are seen as engaged in a contest for influence in Afghanistan.
After years of costly involvement, most NATO troops pulled back from the frontlines by the end of 2014, although a residual force of around 13,000 remains for training and counter-terrorism operations.