President Donald Trump on Wednesday warned against the threats posed by "a country ruled by a cult" in North Korea in a hard-line speech aimed at rallying international pressure on Pyongyang over its escalating nuclear weapons program.

Trump said dictator Kim Jong Un's regime seeks to "sow conflict abroad to distract from total failure they suffer at home" in his address to the South Korean national assembly.

"Do not underestimate us," Trump said, addressing North Korea. "And do not try us. We will defend our common spirit, our shared prosperity and our sacred liberty."

He emphasized the United States is not seeking conflict, but he added that: "We will never run from it. History is filled with discarded regimes that has foolishly tested America's resolve."

"We will not be intimidated," Trump said.

The remarks came a day after Trump had asserted that his administration is making "a lot of progress" in the peninsula and urging dictator Kim Jong Un to "make a deal" at the negotiating table on the rogue nation's nuclear weapons and ballistic missile programs.

"I believe it makes sense for North Korea to do the right thing, not only for North Korea but for humanity all over the world," Trump said during a joint news conference with South Korean President Moon Jae-in after a bilateral meeting at the Blue House.

"I do see certain movement, yes, but we'll see what happens," he added, without offering any details.

Trump has previously dubbed Kim "Little Rocket Man," promised "fire and fury" if North Korea endangers the United States, and undercut Secretary of State Rex Tillerson by tweeting that his top diplomat was "wasting his time" trying to negotiate with the regime.

On Tuesday, Trump praised Chinese President Xi Jinping, whom he will meet in Beijingfor a three-day summit starting Wednesday, for being "very helpful" and added that China is "trying very hard to solve the problem." He also offered hope that Russia will "likewise be helpful."

Trump has said he expects to meet Russian President Vladimir Putin at a regional summit later in the week, either in Vietnam or the Philippines.

"This is not the right time to be doing it, but that's what I got," Trump said, complaining that his predecessors in the White House had failed to solve the issue. "This is a problem that should have been taken care of a long time ago."

The president on Tuesday avoided the type of heated rhetoric he has employed in the past while talking about North Korea, but he emphasized that the United States is "showing great strength."

North Korea "knows we have unparalleled strength," Trump said. "There's never been strength like this." He also cited the presence of three aircraft carriers and a nuclear submarine in the region, a muscular military presence in the Pacific that belied his more conciliatory tone on his first full day in South Korea.

"We have many things happening that we hope, we hope - in fact, I'll go a step further - we hope to God we never have to use," Trump said.

On Wednesday morning, Trump attempted to make a surprise visit to the demilitarized zone, but his helicopter was forced to turn back because of bad weather. Moon was expected to join him at the dangerous border, in what White House press secretary Sarah Huckabee Sanders billed as a "historic moment" - the first time leaders of both the United States and South Korea would have visited the DMZ together.

Sanders alerted reporters traveling with the president to the surprise trip by holding up a piece of paper on which "DMZ" had been scrawled and announcing, "This is where we're going."

White House officials, at least publicly, had scrapped the idea of a trip to the DMZ before Trump left Washington - with one even describing it as "a little bit of a cliche" - but the president had repeatedly hinted at "a surprise" while in South Korea, and many aides privately said they didn't think Trump would be able to resist a visit - and the ensuing photo opportunity.

Before their news conference Tuesday, Trump and Moon - whose relationship is more distant than Trump's friendships with Xi and Japanese Prime Minister Shinzo Abe - seemed to bond a bit. The two leaders took a "friendship walk" and dined together at a state dinner, complete with tea blended with hydrangeas from the region where South Korea will host its upcoming Winter Olympics. Moon also made a point of praising Trump for the upcoming anniversary of his Election Day victory.

The president toured Camp Humphreys, the third military base he has visited since leaving Washington on a 12-day trip to the Asia-Pacific region that began on Friday.

Trump landed at the $11 billion base, 40 miles south of Seoul, on Marine One and, after saluting several commanding officers on the tarmac, went to the mess hall to have lunch with troops. He sat down on a bench at a long table in between soldiers dressed in green military fatigues. Trump was accompanied by Moon, as well as Tillerson, Chief of Staff John Kelly and national security adviser H.R. McMaster.

Wearing a navy blue suit and a bright blue tie, Trump smiled and waved at reporters.

"Ultimately, it will all work out. It always works out. It has to work out," Trump said at the start of a briefing with military commanders at the base.

The tour of Camp Humphreys comes on the heels of Trump's visits to Yokota Air Base outside Tokyo and Pearl Harbor in Hawaii.

"The United States remains committed to the complete, verifiable and permanent denuclearization of the Korean Peninsula," McMaster said last week. "President Trump will reiterate the plain fact that North Korea threatens not just our allies, South Korea and Japan, and the United States - North Korea is a threat to the entire world. So all nations of the world must do more to counter that threat."

But South Koreans are on edge for Trump's visit, and police have worked to keep protesters at bay. Trump has low public approval numbers here amid concerns that his heated rhetoric toward Kim Jong Un's regime could lead to a military confrontation. The president has emphasized that military options remain on the table, although he has declined to be specific.

Foreign policy analysts said the stakes are high for Trump to deliver a speech on Wednesday that clearly spells out his administration's North Korea policy. The administration has made progress in ramping up pressure on the North, but analysts said many in Seoul, as well as in Tokyo and Beijing, remain confused because Trump and his senior aides have offered mixed messages.

"People want clarification," said a former State Department official who worked on Asian affairs during the Obama administration. He spoke on the condition of anonymity because his current job outside government does not allow him to speak on the record. "There's a lot of nervousness in South Korea."

A senior administration official said Trump will use his speech to highlight the North Korean regime's long history of human rights abuses - against its own people and abroad. Trump lashed out at Kim after the North released Otto Warmbier, an American college student who had been detained for 17 months, comatose. Warmbier died shortly after arriving home in Ohio.

In the speech, there will be "some focus on the often-overlooked question of the human rights conditions of North Korea," said the administration official, who was not authorized to speak on the record in a briefing for reporters in Tokyo on Sunday. "I heard one journalist recently described it as the most totalitarian state in the history of humankind. I don't think that's an overstatement."

In Tokyo on Monday, Trump met with the families of Japanese citizens who were abducted by North Korean agents four decades ago to help the regime learn the Japanese language and culture. Five abductees were released more than a decade ago, but at least a dozen remain in the North, according to the Japanese government.

In a news conference Monday with Abe, Trump dismissed suggestions that his rhetoric has created more risk for the United States and its allies. Trump vowed during a United Nations address in September that his administration is prepared to "totally destroy" North Korea if necessary, and he has dubbed Kim the "Little Rocket Man" in tweets.

"Some people said that my rhetoric is very strong, but look what's happened with very weak rhetoric over the last 25 years," Trump said. "Look where we are right now."

Yet as he has traveled to the region, Trump also has offered notes of encouragement for North Korean citizens, calling them "great people."

"They're under a very repressive regime, and I really think that, ultimately, I hope it all works out," he said.