Mattis was in the South Korean capital before going on to Tokyo, on the first overseas tour by a senior Trump administration official as concerns rise about the direction of US policy in the region under the protectionist and fiery leader.
South Korea has enjoyed US security protection since the 1950-53 Korean War, but on the campaign trail, Trump threatened to withdraw US forces from it and Japan if they do not step up their financial support.
Pyongyang was continuing to "engage in threatening rhetoric and behaviour", said Mattis, who first came to the South in 1972 as a 21-year-old lieutenant in the US military.
"Any attack on the United States or our allies will be defeated and any use of nuclear weapons would be met with a response that would be effective and overwhelming," Mattis told reporters ahead of a meeting with his South Korean counterpart Han Min-Koo.
He was in Seoul to "underscore America's priority commitment to our bilateral alliance" and make clear the administration's "full commitment" to defending South Korea's democracy," he said.
North Korea carried out two atomic tests and a series of missile launches last year, and casts a heavy security shadow over the region.
Leader Kim Jong-Un said in his closely-watched New Year speech that Pyongyang was in the "final stages" of developing an intercontinental ballistic missile, prompting Trump to tweet: "It won't happen!"
Ahead of his departure for Japan, Mattis laid a wreath at the Tomb of the Unknown Soldier in the Seoul National Cemetery, where he met several hundred supporters and Korean War veterans waving American flags and pictures of Trump.
The two confirmed that they will go ahead with the installation of the Terminal High Altitude Area Defense (THAAD) system in the South this year as planned.
Beijing fears it will undermine its own ballistic capabilities, weakening its nuclear deterrent. It has repeatedly condemned the move as destabilising regional security, and imposed measures seen as economic retaliation in South Korea.
Disclaimer: No Business Standard Journalist was involved in creation of this content
