U.S. President Donald Trump on Wednesday warned North Korea of serious consequences if it dares to challenge Washington and urged China to do more to isolate its neighbor.

"I speak not only for our countries, but for all civilized nations, when I say to the North: Do not underestimate us, and do not try us," Trump said in a speech to South Korea's parliament. "We will not permit America or our allies to be blackmailed or attacked."

Trump said the international community "cannot tolerate the menace of a rogue regime that threatens it with nuclear devastation, and every "responsible" country, including China and Russia, must do more to "isolate" North Korea by downgrading diplomatic ties and cutting off trade.

"It is our responsibility and our duty to confront this danger together because the longer we wait, the greater the danger grows, and the fewer the options become," he said. "Those nations that choose to ignore this threat or, worse still, to enable it, the weight of this crisis is on your conscience."

Trump's remarks came as he wrapped up his two-day visit to South Korea and just hours before he was to depart to his next destination: China -- a key ally of North Korea that has been under pressure for months from Washington to use more of its leverage over Pyongyang.

A day after striking a somewhat conciliatory note, Trump sent a stern message to North Korean leader Kim Jong Un, who has shown no signs of halting its rapid development of nuclear and missile technologies.

He said the message to "the leader of the North Korean dictatorship" is that "the weapons you are acquiring are not making you safer. They are putting your regime in grave danger. Every step you take down this dark path increases the peril you face."

Trump also described North Korea as a country ruled as a "cult," a "hell that no person deserves," and denounced its inhumane treatment of not only its own citizens, but also foreigners.

In an obvious reference to foreigners abducted by Pyongyang in the past, including Japanese citizens in the 1970s and 1980s, he said, "Soldiers have kidnapped foreigners and forced them to work as language tutors for North Korean spies."

Trump, whose speech at the National Assembly marked the first by a U.S. president since 1993, said he wants "peace through strength" and stressed that the three largest U.S. aircraft carries, together with their "magnificent" F-35 and F-18 fighter jets, and U.S. nuclear submarines are currently positioned in the vicinity of the Korean Peninsula.

"The regime has interpreted America's past restraint as weakness. This would be a fatal miscalculation," he said. "This is a very different administration than the United States has had in the past."

On Tuesday during a press conference following talks with South Korean President Moon Jae In, Trump said because of the "unparalleled" military strength of the United States, there has been a "lot of progress" in dealing with North Korea and called for a "deal" with Kim.

In his speech Wednesday to the South Korean parliament, the tone of Trump's comments was stronger, but he still tried to reach out to Kim's government.

"Despite every crime you have committed against God and man...we will offer a path to a much better future," Trump said. "It begins with an end to the aggression of your regime, a stop to your development of ballistic missiles, and complete, verifiable, and total denuclearization."

"A sky-top view of this peninsula shows a nation of dazzling light in the South and a mass of impenetrable darkness in the North," he said. "We seek a future of light, prosperity, and peace. But we are only prepared to discuss this brighter path for North Korea if its leaders cease their threats and dismantle their nuclear program."

There has been an unusual pause in North Korea's saber-rattling since it fired a ballistic missile over Japan on Sept. 15 in the longest-ever flight by a one of its missiles -- and enough to have reached the U.S. Pacific territory of Guam.

Before Wednesday's speech, Trump cancelled -- due to bad weather -- what was to be a surprise visit to the demilitarized zone dividing North and South Korea.

Trump was to join Moon at the border area, but the helicopter carrying him was forced to return to Seoul in the morning because of thick fog, according to U.S. and South Korean officials.

Before Trump's two-day trip to South Korea on the second-leg of his five-nation Asian tour, both U.S. and South Korean officials had said he would not visit the zone. But during their talks Tuesday, Moon suggested visiting the DMZ together, according to a South Korean government official.

The joint visit to the DMZ would have been the first by U.S. and South Korean presidents and a "historic moment," White House press secretary Sarah Sanders told reporters in Seoul.

"The effort shows the strength and importance of the alliance between the two countries," Sanders said.

Previous U.S. presidents have traveled to the DMZ to demonstrate their resolve to counter the threat posed by North Korea to the South and the wider world.

On Tuesday, Trump visited Camp Humphreys, a major U.S. base located south of Seoul.