U.S. Defense Secretary Jim Mattis issued a stern warning to North Korea on Saturday: Despite its ongoing missile and nuclear programs, it is simply no match for the U.S.-South Korea alliance.

“Make no mistake,” Mattis said during a news conference in Seoul, “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.”

During the joint appearance with South Korean Defense Minister Song Young-moo, Mattis acknowledged that the threat of a nuclear missile attack by North Korea was accelerating.

The CIA says North Korea could be just months away from being capable of hitting the U.S. with a nuclear strike, Reuters reported.

Mattis accused the regime of Kim Jong Un of illegal and unnecessary missile and nuclear programs -- and vowed to defeat any attack.

He said the North engages in "outlaw" behavior and that the U.S. would 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," Mattis 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.

"I cannot imagine a condition under which the United States would accept North Korea as a nuclear power." — U.S. Defense Secretary Jim Mattis

As he emphasized throughout his weeklong Asia trip – which comes ahead of President Donald Trump’s own scheduled tour of East Asia next week -- Mattis said diplomacy remains the preferred way to deal with the North.

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

Limits would be lifted

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.

Second visit to region

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.

The Associated Press contributed to this story.