Kabul flew in hundreds of commandos to Qala-e-Naw in Badghis, the first provincial capital to face an all-out assault by the Taliban.

Afghan security personnel stand guard along a road amid ongoing fight between Afghan security forces and Taliban fighters in Qala-e-Naw
Afghan security personnel stand guard along a road amid ongoing fight between Afghan security forces and Taliban fighters in Qala-e-Naw (AFP)

Afghan government forces have retaken control of a western provincial capital, a day after the Taliban fighters stormed the city in the most brazen assault since the United States stepped up its troops withdrawal from the war-torn country.

"The Taliban have been pushed back by special forces and more troops are deployed to the city as a clearing operation is underway," Hasamuddin Shams, the provincial governor, told TRT World on Thursday.

The government flew in hundreds of commandos to Qala-e-Naw in Badghis, the first provincial capital to face an all-out assault by the Taliban since May 1 when the insurgents launched a blistering campaign to capture new territory.

Residents in Qala-e-Naw had either fled the city or stayed indoors Thursday after more than 24 hours of intense fighting that saw the Afghan air force launch strikes on Taliban positions.

Afghan officials said about 75,000 people have fled their homes, either to neighbouring districts or to Herat.

The Ministry of Defense issued a statement on Thursday saying “a large number of Afghan commandos have arrived on Wednesday night in Qala-e-Naw".

On Wednesday, the Taliban briefly seized the police headquarters and the local office of the country's spy agency but were later pushed back.

As news of the assault spread, social media was flooded with videos of clashes - with some showing armed Taliban fighters on motorbikes entering the city, as onlookers cheered.

Local officials said some security officers had surrendered to the Taliban, and the insurgents opened the gates of the city jail, freeing hundreds of prisoners.

READ MORE: The Taliban is convincing Afghan forces not to fight them

Most had since been recaptured, officials said.

Overnight, the defence ministry said it rushed hundreds of commandos to the city to launch a "large scale operation", spokesman Fawad Aman said on Twitter.

The fighting appeared to be spreading in neighbouring Herat province where officials acknowledged losing two districts to the insurgents.

The attack on Qala-e-Naw comes as the Taliban carry out a blistering campaign across the country but mostly in the north, capturing dozens of districts since early May.

Source: TRTWorld and agencies