Afghanistan's army chief and defence minister have resigned following a Taliban attack on an army base over the weekend that killed more than 100 people, as the US defence secretary arrived in Kabul on an unannounced visit.

The attack, the biggest ever by the Taliban on a military base in Afghanistan , involved multiple attackers and suicide bombers in army uniforms who penetrated the compound of the 209th Corps of the Afghan National Army in northern Balkh province on Friday.

The Taliban claimed responsibility for the assault, which according to some estimates killed over 130 people.

President Ashraf Ghani accepted the resignations of Qadam Shah Shahim, the army chief of staff and Abdullah Habibi, the country's defence minister, on Monday, according to a statement from the president's office.

Jim Mattis was expected to meet Afghan officials and US troops, but his arrival coincided with the Friday's Taliban assault. Sources told Al Jazeera that his arrival is to determine role and goals of the US troops in Afghanistan.

"It is not an easy time. An attack of this scale has affected many people in this country and of course us as well, but these resignations did not affect our morale," General Dawlat Waziri, a spokesperson of the Afghan Ministry of Defense, told Al Jazeera.

"We will make sure that whoever is responsible for this attack will face our wrath, they [attackers/Taliban] need to get ready now."

IN PICTURES: The Afghans on the frontlines fighting the Taliban

Protesters gathered outside the presidential palace in Kabul on Monday mounting pressure for officials to held accountable, but not many did not participate in the demonstration due to high security alert in the area.

"Our government is responsible for what happened to our soldiers in Balkh and we want accountability, we demand it," Mustafa Aminizada told Al Jazeera.

"This can not keep going on, it is too much for us. The government needs to make some serious changes."

Al Jazeera's Rob McBride, reporting from Kabul, said they were forced to resign and their positions were "untenable".

"Given the scale of the attack, which has been described as nothing short of a massacre, there have been growing calls on social media, the local media, the streets and even in parliament for both of these men to go," he said.

"Both of these men were under pressure for a similar attack just over a month ago when infiltrators managed to get inside a hospital and claimed more than 50 lives."

"The defence minister managed to escape a vote of no-confidence in parliament and narrowly held on to his job. So, both men have now taken a logical step."

On Sunday, Afghanistan marked a day of national mourning , with memorial services held at mosques and the Afghan flag flying at half-staff on government buildings and offices across the country.

READ MORE: Hamid Karzai calls MOAB 'brutal act against innocent people'

The attack in Balkh raises serious questions about the Afghan military's capability to stand on its own in the civil war following the withdrawal of foreign combat forces at the end of 2014.

"We're also approaching a sensitive time when the Taliban launches its spring offensive. The military has to be on its guard," our correspondent said.

"This attack further undermines the military. There has already been talk about corruption and allegations of poor leadership. This does nothing to strengthen the army at this time."

Al Jazeera's political analyst, Hashmat Moslih, said the attack highlighted the continuous failure of military intelligence as well as the wider intelligence gathering of security forces.

"While the Taliban have homed in on toppling the government, the government's efforts are scattered," he said.

"The government is predominantly engaged in undermining its political rivals within the power sharing government."

The American and other foreign troops remaining in Afghanistan are now mostly acting in an advisory and training role, with some combat assistance.