As he left, he saw the carnage unfold.
The attackers arrived at the barracks in two army 4x4 vehicles, claiming they had injured personnel on board and shot their way through checkpoints when asked to surrender their weapons.
The defence ministry gave a figure of at least 100 soldiers killed or wounded.
Officials put the death toll in that attack at 50, but security sources and survivors told AFP more than 100 were killed in the brazen assault. "Our enemy sensed that and they have redoubled their efforts, and it's time for us, alongside our Afghan partners, to respond", he said. "How can a suicide attacker go inside?"
Afghan soldiers stand guard at the gate of a military compound after an attack by gunmen in Mazar-e- Sharif province north of kabul, Afghanistan, Friday, April 21, 2017.
"We will make sure that whoever is responsible for this attack will face our wrath, they [attackers/Taliban] need to get ready now". On Friday, the extremists barged into an army camp and killed scores of soldiers in the northern city of Mazar-i-Sharif.
He referred to the use of the Massive Ordnance Air Blast bomb to target the Islamic State in Nangarhar about a fortnight ago and said the attack was meant to "send a very clear message to ISIS". "I request the government to punish those who helped those terrorists".
The 209-Shaheen Corps, which came under the Taliban's attack, is one of the seven corps of the Afghan National Army (ANA) that has responsibility to ensure security in north and north-eastern provinces of the country.
Mattis also said the Taliban will have to renounce violence and reject terrorism to join the political process.
The slaughter at the base's mosque and in a dining facility lasted around six hours.
The Afghan army is preparing for what is expected to be a year of hard fighting against Taliban militants, who now control or contest more than 40 per cent of the country.
The officials said that President Ashraf Ghani accepted the resignations on Monday.
Mattis also is visiting the headquarters of Operation Resolute Support, the NATO-led mission to train and advise Afghan security forces.
The statement said that at this meeting, discussions centered on the current situation in the country and on the reinforcement and development of security forces.
From January 1 through November 12 past year, 6,785 Afghan national security forces were killed, according to the latest quarterly report of the special inspector general for Afghanistan reconstruction.