The Taliban tightened the noose around northern Afghanistan Sunday, capturing three more provincial capitals as they take their fight to the cities after seizing much of the countryside in recent months.

The insurgents have snatched up five provincial capitals in Afghanistan since Friday in a lightning offensive that appears to have overwhelmed government forces.

Fighting in Afghanistan's long-running conflict has intensified since May, when foreign forces began the final stage of a withdrawal due to be completed later this month.

Kunduz, Sar-e-Pul and Taloqan in the north fell within hours of each other Sunday, lawmakers, security sources and residents in the cities confirmed.

In Kunduz, capital of the province of the same name, one resident described the city as being enveloped in "total chaos".

"After some fierce fighting, the mujahideen, with the grace of God, captured the capital of Kunduz," the Taliban said in a statement.

"The mujahideen also captured Sar-e-Pul city, the government buildings and all the installations there."

The insurgents said on Twitter later Sunday that they had also taken Taloqan, the capital of Takhar province.

Parwina Azimi, a women's rights activist in Sar-e-Pul, told AFP by phone that government officials and the remaining forces had retreated to an army barracks about three kilometres (two miles) from the city.

Afghan forces were fighting the Taliban in northern city Kunduz, a day after the insurgents took their second provincial capital
Afghan forces were fighting the Taliban in northern city Kunduz, a day after the insurgents took their second provincial capital AFP / STR

The Taliban had the compound "surrounded", said Mohammad Hussein Mujahidzada, a member of the provincial council.

Taloqan was the next to fall, with resident Zabihullah Hamidi telling AFP by phone that he saw security forces and officials leave the city in a convoy of vehicles.

"The city is unfortunately fully in Taliban hands," a security source told AFP.

Kunduz is the most significant Taliban gain since the May offensive began -- it has been a perennial target for the insurgents, who briefly overran the city in 2015 and again in 2016 but never managed to hold it for long.

The defence ministry said government forces were fighting to retake key installations.

Spokesman Mirwais Stanikzai said that reinforcements including special forces had been deployed to Sar-e-Pul and Sheberghan.

"These cities that the Taliban want to capture will soon become their graveyards," he added.

Map of Afghanistan locating Zaranj, Sheberghan, Kunduz and Sar-e-Pul, cities that fell to the Taliban.
Map of Afghanistan locating Zaranj, Sheberghan, Kunduz and Sar-e-Pul, cities that fell to the Taliban. AFP / STAFF

Kabul's ability to hold the north may prove crucial to the government's long-term survival.

Northern Afghanistan has long been considered an anti-Taliban stronghold that saw some of the stiffest resistance to militant rule in the 1990s.

The region remains home to several militias and is also a fertile recruiting ground for the country's armed forces.

"The capture of Kunduz is quite significant because it will free up a large number of Taliban forces who might then be mobilised in other parts of the north," said Ibraheem Thurial, a consultant for International Crisis Group.

Washington's former envoy to Kabul, Ryan Crocker, said a prolonged civil war is a more likely outcome than a swift Taliban takeover of the entire country.

"They're doing what they're doing in part to create a climate of fear and panic," Crocker, told ABC's "This Week".

Vivid footage of the fighting was posted on social media over the weekend, including what appeared to be large numbers of prisoners being freed from jails in captured cities.

The Taliban frequently target prisons to release incarcerated fighters to replenish their ranks.

On Friday, the insurgents seized their first provincial capital, Zaranj in southwestern Nimroz on the border with Iran, and followed it up by taking Sheberghan in northern Jawzjan province the next day.

The pace of Taliban advances has caught government forces flatfooted, but they won some respite late Saturday after US warplanes bombed Taliban positions in Sheberghan.

Sheberghan is the stronghold of notorious Afghan warlord Abdul Rashid Dostum, whose militiamen and government forces were reportedly retreating east to Mazar-i-Sharif in Balkh province.

Dostum has overseen one of the largest militias in the north and garnered a fearsome reputation fighting the Taliban in the 1990s -- along with accusations his forces massacred thousands of insurgent prisoners of war.

A retreat of his fighters dents the government's recent hopes that militias could help the overstretched military.

Hundreds of thousands of Afghans have been displaced by the recent fighting, and on Saturday, 12 people were killed when their bus was struck by a roadside bomb as they tried to flee Gardez in Paktia province.

"I lost my mother, father, two brothers, two sisters-in-law and other members of the family," said Noor Jan.

The withdrawal of foreign forces is due to finish at the end of this month ahead of the 20th anniversary of the September 11 attacks. The US-led invasion sparked by 9/11 toppled the first Taliban regime in 2001.