The visit, which was not announced due to security concerns, comes after the United States stepped up assistance to the Afghan military as part of a new regional strategy announced last year.
Before landing, Mattis told reporters that the US had picked up signs of readiness from some groups of Taliban insurgents to enter into possible peace talks with the government in Kabul.
He said there were "elements of the Taliban clearly interested in talking with the Afghan government," while admitting that not all the rebels would be prepared to do so.
Read more: Is US pressure pushing Taliban toward peace?
Offer of talksAfghan President Ashraf Ghani last month offered talks without preconditions to the Taliban insurgents, who have previously said they would talk only with Washington about a possible peace agreement. They have so far not responded to Ghani's overture.
The US, however, holds the position that any talks should be led by Kabul, a stance Mattis reiterated on Tuesday.
"We want the Afghans to lead and provide the substance to the reconciliation effort," Mattis said.
But he said the US was looking for victory in Afghanistan after more than 16 years of conflict, though he said current developments were leading not to a military victory, but "a political reconciliation."
During his visit, Mattis plans to meet with General John Nicholson, the top US commander in Afghanistan, and Ghani.
Precarious security situationMattis' visit comes a week after US intelligence officials told Congress that the Taliban was likely to continue to threaten Afghan stability in 2018, despite an improvement in Afghan security forces.
Taliban fighters control large parts of the country and thousands of Afghan soldiers and civilians are being killed every year, with a divided Kabul government unable to take effective action.
The war in Afghanistan has been running since a US-led invasion in 2001 toppled the then-ruling Taliban, which Washingon accused of colluding with terrorist group al-Qaida and harboring its leader Osama bin Laden, who was wanted over the September 11 attacks on the United States.
tj/rc (Reuters, AP)
Every evening at 1830 UTC, DW editors send out a selection of the day's hard news and quality feature journalism. You can sign up to receive it directly here.