Afghanistan's defence minister and army chief have quit following the Taliban slaughter which claimed the lives of nearly 140 unarmed soldiers and left scores of others injured. The presidential office announced it has accepted the resignations.

About 10 heavily armed Afghan Taliban insurgents stormed a military base in Mazar-i-Sharif – which was hosting hundreds of troops at the time of the attack – on 21 April as the soldiers were wrapping up their Friday prayers. The assailants randomly sprayed bullets on the troops in one of the deadliest attacks in the war-torn nation's recent past.

"President Ashraf Ghani has accepted the resignations of the defence minister and army chief of staff. Defence Minister Abdullah Habibi and Army Chief of Staff Qadam Shah Shahim stepped down with immediate effect," said a statement released by President Ashraf Ghani's office.

While Interior Minister Tariq Shah Bahrami has been temporarily given additional charge of the defence portfolio, General Sharif Yaftal has been asked to take over as the army chief of staff for now.

Demands for the top leadership's resignation have been growing since the attack, which is considered a serious security failure on the part of the military. For long, Mazar-i-Sharif, northern Afghanistan's largest military installation, has been considered a safe territory given the highly volatile situation in other parts of the country and Taliban's renewed offensive in recent months.

Afghanistan Taliban attack
A member of Afghanistan's special forces points his gun in Achin district of Nangarhar province in eastern Afghanistan Parwiz Parwiz/Reuters

The military shakeup following the deadly attack is seen as a wakeup call for the Afghan army, which has been struggling to contain Taliban – the Islamist group which controls close to 40% of Afghan territories and is rapidly spreading its tentacles.

Meanwhile, as a show of support, US Defence Secretary Jim Mattis arrived in Afghanistan on an unannounced visit on Monday, 24 April. He is the Trump administration's first top official to land in Afghanistan where the US is engaged in its longest war.

Mattis will study the security situation and reassess Washington's role in Afghanistan.