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.
Ten gunmen dressed in soldiers' uniforms and armed with suicide vests entered the base in army trucks and opened fire at unarmed troops at close range in the mosque and dining hall.
It is believed to be the deadliest-ever Taliban attack on an Afghan military target, though the exact toll from the assault remains unclear.
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.
The raid underscores the Taliban's growing strength more than 15 years since they were ousted from power, and as they gear up ahead of the spring fighting season.
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.
Mattis, who has previously served in Afghanistan, has said he is compiling an assessment for President Donald Trump on Afghanistan's brutal and seemingly intractable conflict.
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 H.R. McMaster arrived in Kabul days after the MOAB was dropped.
The US has around 8,400 troops in the country with about another 5,000 from NATO allies assisting a much larger Afghan force in the war against the Taliban and other Islamist militants.
Afghan security forces, beset by killings and desertions, have been struggling to beat back insurgents since US-led NATO troops ended their combat mission in December 2014.
According to US watchdog SIGAR, casualties among Afghan security forces soared by 35 percent in 2016, with 6,800 soldiers and police killed.
More than a third of Afghanistan is outside government control and many regions are fiercely contested by various insurgent groups, as Kabul's repeated bids to launch peace negotiations with the Taliban have failed.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)