SEOUL, South Korea — The threat of a nuclear missile attack from North Korea is accelerating, U.S. Defense Secretary Jim Mattis said Saturday during a visit to Seoul.

In remarks alongside South Korean Defense Minister Song Young-mool, Mattis accused the North of illegal and unnecessary missile and nuclear programs — and vowed to defeat any attack.

Mattis said North Korea continues to engage in "outlaw" behavior and that the U.S. will never accept a nuclear North.

He added that, regardless of what the North might try, it is overmatched by the firepower and cohesiveness of the decades-old U.S.-South Korean alliance.

"North Korea has accelerated the threat that it poses to its neighbors and the world through its illegal and unnecessary missile and nuclear weapons programs," he said, adding that U.S.-South Korean military and diplomatic collaboration thus has taken on "a new urgency."

"I cannot imagine a condition under which the United States would accept North Korea as a nuclear power," he said.

As he emphasized throughout his weeklong Asia trip, which included stops in Thailand and the Philippines, Mattis said diplomacy remains the preferred way to deal with the North.

"With that said," he added, "make no mistake — any attack on the United States or our allies will be defeated, and any use of nuclear weapons by the North will be met with a massive military response that is effective and overwhelming."

Related: Poll: America's Fear of North Korea Is on the Rise

Mattis' comments did not go beyond his recent statements of concern about North Korea, although he appeared to inject a stronger note about the urgency of resolving the crisis.

Nor did he mention President Donald Trump’s escalating rhetoric. In August, Trump warned the North not to make any more threats against the United States, and said that if it did, it would be met with "fire and fury like the world has never seen."

Song told Saturday's news conference that he and Mattis agreed to further cooperation on strengthening Seoul's defensive capabilities, including lifting warhead payload limits on South Korean conventional missiles and supporting the country's acquisition of "most advanced military assets." He offered no specifics and refused to answer when asked whether the discussions included nuclear-powered submarines.

James Mattis shakes hands with South Korean Defense Minister Song Young-moo. Chung Sung-Jun / Getty Images

Some South Korean government officials have endorsed the nation getting nuclear-powered submarines amid calls for more military strength. There's a growing concern among the South Korean public that North Korea's expanding nuclear weapons arsenal, which may soon include an intercontinental ballistic missile that could target the U.S. mainland, would undermine Seoul's alliance with Washington.

South Korea's conservative politicians have also called for the United States to bring back tactical nuclear weapons that were withdrawn from the Korean Peninsula in the 1990s, which they say would make clearer the U.S. intent to use nukes in a crisis. But Mattis and Song were strongly dismissive of the idea.

Related: A Generation Grapples With North Korea as Friend and Foe

"When considering national interest, it's much better not to deploy them," said Song, adding that the allies would have "sufficient means" to respond to a North Korean nuclear attack even without placing tactical nukes in the South. Mattis said current U.S. strategic assets are already providing nuclear deterrence and that the South Korean government has never approached him with the subject of tactical nukes.

On Friday, Mattis visited the Demilitarized Zone that has formed an official buffer between the two Koreas since fighting ceased in the Korean War in 1953. He appeared there with Song in what they both called a show of solidarity.

The neighbors are technically still in conflict because the war ended with an armistice, rather than a peace treaty. In the decades since, the North has issued regular apocalyptic threats, saying it will engulf Seoul in "a sea of fire.".

U.S. government officials for decades have confidently but mistakenly predicted the approaching collapse of North Korea, given its economic and political isolation.