President Trump issued a stern warning to North Korea and words of reassurance to South Korea in a major speech Wednesday about his administration’s policy toward the Korean Peninsula.

“Today, I hope 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 during a speech before the National Assembly in Seoul. “We will defend our common security, our shared prosperity, and our sacred liberty."

Trump praised the Southeast Asian ally that he has spent the past 24 hours visiting on his five-country tour of the region. The White House has said countering Pyongyang’s aggression is a major goal of Trump’s 12-day tour.

“The more successful South Korea becomes, the more decisively you discredit the dark fantasy at the heart of the Kim [Jong Un] regime,” Trump said.

The president warned North Korea against making further threats against the U.S.

"We will not allow American cities to be threatened with destruction. We will not be intimidated. And we will not let the worst atrocities in history be repeated here, on this ground we fought and died to secure,” Trump said.

"The world cannot tolerate the menace of a rogue regime that threatens it with nuclear devastation. All responsible nations must join forces to isolate the brutal regime of North Korea — to deny it any form of support, supply, or acceptance,” he added.

Trump’s speech to the National Assembly on Wednesday marked his most substantive remarks about the North Korean threat since he left for his 12-day tour of the region on Friday. The president’s five-country trip will be the longest a U.S. president has spent in Asia since George H.W. Bush’s journey to the continent in 1991, the White House said.

Trump has softened his language on North Korea since touching down in Seoul on Tuesday. Instead of threatening to rain down “fire and fury like the world has never seen” on Pyongyang, Trump suggested this week that military force would remain the last resort in its efforts to keep Kim Jong Un in check.

“As we work together to resolve this problem using all available tools short of military action, the United States stands prepared to defend itself and its allies using the full range of our unmatched military capabilities if need be,” Trump said during a joint appearance with Moon on Tuesday.

The change in Trump’s tone could reflect the challenges he faces in dealing with South Korea, a top U.S. ally in the region. South Koreans have bristled at Trump’s combative rhetoric when it comes to their northern neighbor, and the president was forced during his one-day stop in Seoul to walk a tightrope between reassuring an ally and warning an adversary.