President Trump on Thursday again said he could use military force to deter a nuclear weapons threat from North Korea, but refused to say whether he could tolerate a policy of nuclear containment there.

War is not inevitable, Trump said during a news conference with the visiting leader of Kuwait.

“It would be great if something else could be worked out,” he said.

Trump cast doubt that further negotiations could work, however, saying that U.S. presidents have been “talking and talking and talking” to North Korea for 25 years while North Korea has been developing its nuclear capability.

“North Korea is behaving badly and it's gotta stop,” Trump said, after praising U.S. military capability.

“Hopefully we're not going to have to use it on North Korea,” he said. “If we do use it on North Korea, it's going to be a very sad day for North Korea.”

U.S. President Donald Trump (R) welcomes Emir of Kuwait Sabah Al-Ahmad Al-Jaber al-Sabah (L) in the Oval Office at the White House in Washington, U.S., September 7, 2017.

North Korea conducted a sixth nuclear weapons test on Sunday and it has also tested inter-continental ballistic missiles that could reach U.S. territory.

“I would prefer not to go the route of the military, but it's something that certainly could happen,” Trump said.

Asked whether he could live with a nuclear-armed North Korea that is contained and deterred from using its weapons, Trump would not answer directly.

“I don't put my negotiations on the table, unlike past administrations,” Trump said. “I don’t talk about them.”

U.S. policy for decades has insisted that North Korea entirely give up its nuclear weapons.