The threat of nuclear missile attack by North Korea is accelerating, US defence secretary Jim Mattis said.

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

Mr Mattis said the North engages in "over-the-top rhetoric" and behaviour, adding the US will never accept North Korea becoming a nuclear state.

He added the firepower and cohesiveness of the decades-old US-South Korean alliance would be more than a match for anything the North may try.

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

As he emphasised throughout his week-long Asia trip, which included stops in Thailand and the Philippines, Mr 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."

Mr 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" behaviour, he did not mention that president Donald Trump has ratcheted up his own rhetoric.

In August, Mr 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".

At his Seoul news conference, Mr 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 US effort to strangle its economy and overthrow the Kim government.