U.S. Defense Secretary Jim Mattis said Saturday the threat of nuclear missile attack by North Korea is accelerating.

In remarks in Seoul with South Korean Defense Minister Song Young-moo at his side, Mattis accused the North of illegal and unnecessary missile and nuclear programs — and vowed to defeat any attack.

Mattis said the North engages in "over-the-top rhetoric" and behavior. And he said 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.

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."

Mattis's comments in Seoul 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.

While he accused the North of "outlaw" behavior, he did not mention that President Donald Trump has ratcheted up his own 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, the South Korean minister, told the news conference that he and Mattis agreed that limits on South Korea conventional missile warhead payloads would be lifted. He offered no specifics.

Also discussed were the conditions under which South Korea would be given wartime operational control of its forces. Currently, if war with the North broke out, the South's forces would operate under the U.S.-led U.N. Command.

Trump entered office declaring his commitment to solving the North Korea problem, asserting that he would succeed where his predecessors had failed. His administration has sought to increase pressure on Pyongyang through U.N. Security Council sanctions and other diplomatic efforts, but the North hasn't budged from its goal of building a full-fledged nuclear arsenal, including missiles capable of striking the U.S. mainland.

If Trump sticks to his pledge to stop the North from being able to threaten the U.S. with a nuclear attack, something will have to give - either a negotiated tempering of the North's ambitions or a U.S. acceptance of the North as a nuclear power.

The other alternative would be U.S. military action to attempt to neutralize or eliminate the North's nuclear assets - a move fraught with risk for South Korea, Japan and the United States.

At his Seoul news conference, Mattis said the North is, in effect, shooting itself in the foot.

"If it remains on its current path of ballistic missiles and atomic bombs, it will be counterproductive, in effect reducing its security," he said.

The North says it needs nuclear weapons to counter what it believes is a U.S. effort to strangle its economy and overthrow the Kim government.

This was Mattis's second visit to South Korea since taking office in January. He made a point of going to Seoul and Tokyo on his first overseas trip in February, saying he wanted to emphasis the importance he places on strengthening alliances and partnerships.

On Friday he visited the Demilitarized Zone that forms an official buffer between the two Koreas. He appeared there with Song in what they both called a show of solidarity.

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

Twenty years ago, Mattis's predecessor five times removed, William Cohen, said as he peered into North Korea from inside the DMZ that its communist system was "decaying and dying." His view was widely shared in Washington, but, like others, he underestimated the resilience of Pyongyang's family dynasty, which began with Kim Il Sung. The current ruler assumed control of the country shortly after his father, Kim Jong-Il, died in December 2011, and has accelerated the country's nuclear and missile programs.