The Taliban launched a major assault on a provincial capital in Afghanistan on Wednesday, the first since the US military began its final drawdown of troops from the country as insurgents press on with a blistering offensive.
Fierce fighting erupted in the western city of Qala-i-Naw, the capital of Badghis, with the militants seizing police headquarters and offices of the country's spy agency.
As news of the morning assault spread, social media was flooded with videos of clashes -- with some showing armed Taliban fighters on motorbikes entering the city of about 75,000, as onlookers cheered.
Afghanistan's Defence Minister Bismillah Mohammadi said government forces were in a "very sensitive military situation", adding that "the war is raging" with the Taliban.
The onslaught came hours after Washington announced US forces had completed more than 90 percent of their withdrawal from Afghanistan, and as the Kabul government held talks with Taliban representatives in neighbouring Iran.
The militants have waged a dizzying campaign across Afghanistan since US and NATO forces announced the final withdrawal from the country in early May, seizing dozens of districts and stirring fears that the government is in crisis.
"The enemy has entered the city, all the districts have fallen," Badghis governor Hessamuddin Shams told reporters in a text message.
He attempted to calm the residents in a video message, appearing with a rifle -- with gunfire rattling in the distance.
"I assure you that we will, all of us, together defend the city," he said.
- 'City is not falling' -
Provincial council chief Abdul Aziz Bek said some security officials had surrendered to the Taliban, while council member Zia Gul Habibi said the insurgents had entered the city's police headquarters and the local office of the country's spy agency.
Habibi said later the situation was stabilising, but fighting continued.
"The city is not falling, but the Taliban are still in the city and airplanes are hitting their positions," she said, adding the military had deployed drones to strike the insurgents.
Washington's top envoy in Kabul, Ross Wilson, slammed the Taliban for the attack on Qala-i-Naw.
"It violates Afghans' human rights and provokes fears that a system this country's citizens do not support will be imposed," he said on Twitter, urging the insurgents to engage in peace talks and end the fighting.
Residents said the attack triggered fear across Qala-i-Naw.
"Everybody was terrified when they heard the Taliban had entered the city," said Aziz Tawakil, a resident of Qala-i-Naw.
"We could hear sounds of gunfire and explosions... Helicopters and planes are flying over the city and we can see they are sometimes hitting some areas of the city."
Hours after the attack, the defence ministry said its troops had cleared "most parts" of the city.
"In the next few hours all parts of the city will be cleared," ministry spokesman Fawad Aman said on Twitter.
Afghan vice-president Amrullah Saleh tweeted that the bodies of "tens" of Taliban fighters were lying in the streets.
"I demand the respected ICRC (Red Cross) and other organizations to transfer the bodies... The weather is hot, and we do not support disrespecting the bodies," he said.
- Iran talks -
Video also showed the Taliban releasing prisoners from a city prison, but governor Shams said later most of them had been recaptured.
The fight for the city coincided with a high-level summit across the border in Iran, where an Afghan delegation met with Taliban representatives in Tehran, the Iranian foreign ministry said.
Iran's Foreign Minister Mohammad Javad Zarif welcomed the US departure from its eastern neighbour but warned: "Today the people and political leaders of Afghanistan must make difficult decisions for the future of their country."
Last week, all US and NATO forces left Bagram Air Base near Kabul -- the command centre for anti-Taliban operations -- effectively wrapping up their exit after 20 years of military involvement that began in the wake of the September 11 attacks.
Vital US air support for the Afghan forces has been massively curtailed by the handover.
For months the Taliban have been effectively surrounding provincial capitals, with observers predicting the militants were waiting for the complete withdrawal of foreign forces before ordering an onslaught.
After they took much of the north in recent weeks, the fall of Badghis would further tighten the Taliban's grip on western Afghanistan. Their forces have also inched closer to the nearby city of Herat, near the border with Iran.
If the Taliban capture Qala-i-Naw it will be of "strategic value as it creates a psychological effect of Afghan forces rapidly losing territory like dominoes against an unstoppable force", said Afghanistan expert Nishank Motwani.
Over the years, the Taliban have launched periodic assaults on provincial capitals, briefly holding urban areas before being dislodged by US airstrikes and Afghan ground forces.