SEOUL (Reuters) - U.S. President Donald Trump told South Korea’s presidential envoy that Washington was willing to try to resolve the North Korean nuclear crisis through engagement, but under the right conditions, South Korea’s foreign ministry said on Thursday.

U.S. President Donald Trump gestures as he walks on the South Lawn of the White House upon his return to Washington, U.S., May 17, 2017. REUTERS/Yuri Gripas

Trump has said “a major, major conflict” with North Korea is possible and all options are on the table but that he wanted to resolve the crisis diplomatically, possibly through the extended use of economic sanctions.

South Korean President Moon Jae-in, who took office last week, has campaigned on a more moderate approach toward the North but he has said it must change its attitude of insisting on arms development before dialogue can be possible.

Moon’s envoy to Washington, South Korean media mogul Hong Seok-hyun, said Trump spoke of being willing to use engagement to ensure peace, Hong said in comments carried by television.

“The fact that Trump said he will not have talks for the sake of talks reiterated our joint stance that we are open to dialogue but the right situation must be formed,” Foreign Ministry spokesman Cho June-hyuck told a regular briefing.

South Korea and the United States agreed during a visit to Seoul by Trump’s national security advisers this week to formulate a “bold and pragmatic” joint approach, Cho added.

The North has vowed to develop a missile mounted with a nuclear warhead that can strike the mainland United States, saying the program is necessary to counter U.S. aggression.

The United States, which has 28,500 troops in South Korea to guard against the North Korean threat, has called on China to do more to rein in its neighbor.

China for its part has been infuriated by the U.S. deployment of an advanced Terminal High Altitude Area Defense (THAAD) anti-missile system in South Korea, saying it was a threat to its security and would do nothing to ease tension with Pyongyang.

South Korea has complained that some of is companies doing business in China have faced discrimination in retaliation for the system’s deployment.

North Korea conducted its latest ballistic missile test on Sunday in defiance of U.N. Security Council resolutions, saying it was a test of its capability to carry a “large-size heavy nuclear warhead”.

But a senior North Korean diplomat has said Pyongyang is also open to having talks with Washington under the right conditions.

Moon’s envoy to China, former prime minister Lee Hae-chan, arrived there on Thursday with a letter from Moon to Chinese President Xi Jinping.

Before leaving, Lee said a summit between Xi and Moon could happen as soon as July, on the sidelines of a Group of 20 meeting in Germany. A separate summit could also be held the following month, Lee said.

Speaking to Lee, Chinese Foreign Minister Wang Yi said there had been some “undeserved setbacks” in relations this year, in apparent reference to THAAD.

“We hope the new government will correct the problems that we have encountered and take effective measures and positions as soon as possible to remove the obstacles that have been placed on the road to good relations between our two countries,” Wang said in comments in front of reporters.

“This is the desire of our two peoples but also our governments,” Wang added. “We believe South Korea will bring clear measures to improve relations.”

China’s Foreign Ministry, in a later statement on its website, said Wang “fully explained” China’s position on THAAD and asked South Korea to handle China’s reasonable concerns appropriately.

“China is willing to make efforts with all sides, including South Korea, to take even more practical efforts and uphold resolving the nuclear issue on the peninsula via dialogue,” the ministry cited Wang as saying.

Moon has sent envoys to the United States, China, Japan and the European Union this week in what the government calls “pre-emptive diplomacy”. His envoy for Russia will leave next week.