US President Donald Trump has warned North Korea he was prepared to use the full range of military power to stop any attack.

However, in a more conciliatory appeal than ever before, he also urged North Korea to "make a deal" to end the nuclear standoff.

Speaking on North Korea's doorstep during a visit to Seoul, Mr Trump said that while "we hope to God" not to have to resort to the use of full US military might, he was ready to do whatever was necessary to prevent the "North Korean dictator" from threatening millions of lives.

"We cannot allow North Korea to threaten all that we have built," Mr Trump said after talks with South Korean President Moon Jae-in, who has supported diplomatic outreach to Pyongyang.

But at times taking a more measured, less confrontational tone, Mr Trump also urged North Korea to "do the right thing" and added that: "I do see some movement," though he declined to elaborate.

"It really makes sense for North Korea to come to the table and make a deal," Mr Trump told reporters at a joint news conference with Mr Moon.

Despite Mr Trump's renewed threats against North Korea, it was a far cry from the more strident approach he has pursued in recent months, including his previous dismissal of any diplomatic efforts with Pyongyang as a waste of time.

North Korean leader Kim Jong-un has made clear, however, that he has little interest in negotiations - at least until he has developed a nuclear-tipped missile capable of hitting the US mainland.

The White House has billed Mr Trump's trip as intended to demonstrate US resolve over a hardline approach to the North Korean nuclear and missile threats.

But many in the region had expressed fear that any further bellicose rhetoric by Mr Trump toward Pyongyang could increase the potential for a devastating military conflict.

Mr Trump praised Mr Moon for "great cooperation", despite differences in the past over how to confront North Korea and over a trade pact between the US and South Korea.

At the news conference, the leaders said they had agreed to renegotiate the trade agreement in a timely fashion.

In formal talks after an elaborate welcoming ceremony outside the presidential Blue House in Seoul, Mr Moon told Mr Trump he hoped his visit would relieve some of South Koreans' anxiety over North Korea.

Pyongyang’s recent nuclear and missile tests in defiance of UN resolutions and an exchange of insults between Mr Trump and Mr Kim have raised the stakes in the most critical international challenge of Mr Trump’s presidency.