Mattis, making his first visit to Afghanistan as Pentagon chief, was due to meet top officials including President Ashraf Ghani less than two weeks after the US dropped its largest non-nuclear bomb on Islamic State hideouts in the country's east.
He arrived as embattled Afghan security forces faced chaos with the resignations of defence minister Abdullah Habibi and army chief Qadam Shah Shaheem.
The resignations, announced in a terse one-line statement from the presidential palace, came amid fury over the Taliban assault on an army base outside the northern city of Mazar-i- Sharif on Friday.
It is believed to be the deadliest-ever Taliban attack on an Afghan military target, though the exact toll from the assault remains unclear.
More From This Section
Afghan officials have so far ignored calls to break down the toll it has given of more than 100 soldiers killed or wounded, but have been known to minimise casualties in such attacks in the past.
The US has said that at least 50 soldiers were killed, and some local officials have put the number of dead alone as high as 130.
Many Afghans slammed the government for its inability to counter the attack, the latest in a series of brazen Taliban assaults.
Mattis' visit also comes after the US dropped a GBU-43/B Massive Ordnance Air Blast, dubbed the "Mother of All Bombs", on Islamic State hideouts in Achin district in eastern Nangarhar province, killing nearly 100 militants, according to unverified figures from Afghan officials.
The attack triggered global shockwaves, with some condemning the use of Afghanistan as what they called a testing ground for the weapon, and against a militant group that is not considered as big a threat as the Taliban.
The Afghan war is the longest in US history but Trump has scarcely given it a passing mention - other than to call the MOAB strike a success - while campaigning or since entering office.
Mattis said in February his commander-in-chief had been "rightfully reticent" on the matter, as he was waiting for input from his generals.
He is the second senior US security official to visit Afghanistan this month: National Security Advisor General HR McMaster arrived in Kabul days after the MOAB was dropped.