A major Taliban assault on Ghazni has triggered five days of fighting with Afghan security forces, with reports of scores dead and the strategic centre left a "ghost city".

Kabul insists it remains in government hands, but residents have told AFP the insurgents remain entrenched in the streets, burning buildings and targeting civilians. The United Nations said unverified reports put civilian casualties at more than 100.

NATO has dismissed the Taliban assault as an "eye-catching, but inconsequential headline", yet the demoralised Afghan security forces have struggled to overpower the insurgents despite backing from US airpower.

Analysts say the attack is a show of strength with the insurgents under pressure to hold peace talks. Here AFP examines what the Taliban's move means for Afghan security.

Why Ghazni?

Location is key, experts say.

Ghazni is barely two hours drive from Kabul, and straddles the Kabul-Kandahar highway, effectively acting as the main artery to the insurgents' strongholds in the south.

Like other cities the Taliban have stormed in the past -- such as the western city of Farah in May, and Kunduz in the north in 2015 -- Ghazni is also a provincial capital, which are typically bigger and higher-value targets. And, analysts said, the Taliban already had key resources in the area.

"Ghazni has always been a contested province, with a heavy Taliban presence" in most districts, said Kabul-based military analyst Jawed Kohistani, adding that for months there had been reports that the insurgents were threatening the city.

Why now?

The Taliban, analysts said, are demonstrating strength amid tentative signs that diplomatic efforts to kick-start peace negotiations are starting to bear fruit.

"A major military and territorial victory on the eve of perhaps important and direct talks can win the Taliban even more political weight," Kohistani told AFP.

In June, Washington indicated a shift in its longstanding policy that negotiations must be Afghan-led. Last month Taliban representatives met US officials for talks in Qatar, militant sources have told AFP.

"Both sides have just shared initial demands and agreed to continue informal talks," a senior commander based at an unknown location in northwest Pakistantold AFP, adding that "no progress has been made".

The meetings come as the government and the Taliban declared a brief, unprecedented, and widely celebrated ceasefire in June.

Anticipation had been mounting about the possibility of a second government ceasefire announcement for the Islamic holiday of Eid al-Adha, which will be celebrated in Afghanistan on August 21.

Talks about talks have been held many times, but the only direct negotiations with the Taliban for peace took place in Pakistan in 2015. They were derailed by the confirmation that Taliban leader Mullah Omar was dead.

Were officials caught off guard?

It seems so, yes -- even after local authorities warned of the massing insurgents for months.

That raises questions about the ability of Afghan security forces three years after NATO combat troops pulled out, and the political leadership in Kabul, analysts said.

Afghan forces have taken staggering losses since they took over security for the country at the end of 2014. On Tuesday the army announced that a military base with 100 soldiers on it had fallen to the insurgents after days of fighting, with dozens feared killed and captured in the latest blow to morale.

But around Ghazni they may have been too relaxed, underestimating the Taliban's abilities and resources there and putting misplaced confidence in the threat of US airstrikes, analysts said.

Afghan-based political analyst Haroun Mir said generals in the field have also been hobbled by Kabul, citing Afghan President Ashraf Ghani's reputation for micromanagement as a hindrance.

As parliamentary and district elections approach in October, Ghani, for his part, has appeared more focused on the campaign trail than confronting the Taliban.

On Sunday, the third day of fighting in Ghazni, Ghani delivered a wide-ranging speech to mark International Youth Day. In the nearly hour-long address he did not refer to the fighting once.

The glaring omission infuriated Afghans, with commentators berating the sidestep.

"He is totally oblivious," said Mir.

"The successful Taliban onslaught in Ghazni will definitely raise a lot of questions about the management of Afghan security and military leadership and increase calls for reform," said Kohistani.

Authorities have released little information about Ghazni, fuelling rumours of high tolls and mistrust in officials.

US-led forces in Afghanistan have been offering regular statements, but downplayed the fighting, branding it a "failure" by the Taliban to take the city.

What happens now?

Rahimullah Yusufzai, a Taliban and regional expert, said the Taliban had no desire to hold Ghazni, however -- just to show that they could.

"The strategy is to launch big attacks, to show their power, hold the city or town for some days, get their prisoners released, capture some weapons, get some money, create fear -- and then leave," he said.

Kunduz, which briefly fell to the Taliban in September 2015, was later recaptured by Afghan forces backed by US aircraft and NATO soldiers.

The militants launched a major attempt to take over Farah in May this year, triggering intense fighting with US and Afghan forces, who forced the Taliban fighters to the outskirts of the city after a day-long battle.