SEOUL, South Korea — South Korean President Moon Jae-in said Sunday that North Korean leader Kim Jong Un committed in their surprise meeting to sitting down with President Donald Trump and to a “complete denuclearization of the Korean Peninsula.”

The Korean leaders’ second summit in a month saw bear hugs and broad smiles, but their quickly arranged meeting Saturday appears to highlight a sense of urgency on both sides of the world’s most heavily armed border.

At the White House, Trump said negotiations over a potential June 12 summit with Kim that he had earlier canceled were “going along very well.” Trump told reporters that they are still considering Singapore as the venue for their talks. He said there is a “lot of good will,” and that denuclearization of the Korean Peninsula would be “a great thing.”

The Koreas’ talks, which Moon said Kim requested, capped a whirlwind 24 hours of diplomatic back-and-forth. They allowed Moon to push for a U.S.-North Korean summit that he sees as the best way to ease animosity that had some fearing a war last year.

Kim may see the sit-down with Trump as necessary to easing pressure from crushing sanctions and to winning security assurances in a region surrounded by enemies.

Moon told reporters Sunday that Kim “again made clear his commitment to a complete denuclearization of the Korean Peninsula,” and that he told the South Korean leader he’s willing to cooperate to end confrontation and work toward peace for the sake of the successful North Korea-U.S. summit.

This combination of the May 26, 2018 provided May 27, 2018, by South Korea Presidential Blue House via Yonhap News Agency, shows South Korean President Moon Jae-in, left, and North Korean leader Kim Jong Un, right, during their meeting at the northern side of the Panmunjom in North Korea. (South Korea Presidential Blue House/Yonhap via AP)
This combination of the May 26, 2018 provided May 27, 2018, by South Korea Presidential Blue House via Yonhap News Agency, shows South Korean President Moon Jae-in, left, and North Korean leader Kim Jong Un, right, during their meeting at the northern side of the Panmunjom in North Korea. (South Korea Presidential Blue House/Yonhap via AP)

Moon said he told Kim that Trump has a “firm resolve” to end hostile relations with North Korea and initiate economic cooperation if Kim implements “complete denuclearization.”

“What Kim is unclear about is that he has concerns about whether his country can surely trust the United States over its promise to end hostile relations (with North Korea) and provide a security guarantee if they do denuclearization,” Moon said.

“During the South Korea-U.S. summit, President Trump said the U.S. is willing to clearly put an end to hostile relations (between the U.S. and North Korea) and help (the North) achieve economic prosperity if North Korea conducts denuclearization,” he said.

Moon said North Korea and the United States will soon start working-level talks to prepare for the Kim-Trump summit. He said he expects the talks to go smoothly because Pyongyang and Washington both know what they want from each other.

Kim, in a telling line from a dispatch issued by the North’s state-run news service earlier Sunday, “expressed his fixed will on the historic (North Korea)-U.S. summit talks.” During Saturday’s inter-Korean summit, the Korean leaders agreed to “positively cooperate with each other as ever to improve (North Korea)-U.S. relations and establish (a) mechanism for permanent and durable peace.”

They agreed to have their top officials meet again June 1. Moon said military generals and Red Cross officials from the Koreas will also meet separately to discuss how to ease military tensions and resume reunions of families separated by the 1950-53 Korean War.

Saturday’s Korean summit came hours after South Korea expressed relief over revived talks for a Trump-Kim meeting.

Despite repeated references to “denuclearization of the Korean Peninsula” by the North, it remains unclear whether Kim will ever agree to fully abandon his nuclear arsenal.

In this May 26, 2018, photo provided on May 27, 2018, by South Korea Presidential Blue House via Yonhap News Agency, North Korean leader Kim Jong Un, center left, and South Korean President Moon Jae-in, right, walk after their meeting at the northern side of Panmunjom in North Korea. (South Korea Presidential Blue House/Yonhap via AP)
In this May 26, 2018, photo provided on May 27, 2018, by South Korea Presidential Blue House via Yonhap News Agency, North Korean leader Kim Jong Un, center left, and South Korean President Moon Jae-in, right, walk after their meeting at the northern side of Panmunjom in North Korea. (South Korea Presidential Blue House/Yonhap via AP)

The North has previously used the term to demand the United States pull out its 28,500 troops in South Korea and withdraw its so-called “nuclear umbrella” security commitment to South Korea and Japan. The North hasn’t openly repeated those same demands after Kim’s sudden outreach to Seoul and Washington.

Moon has insisted Kim can be persuaded to abandon his nuclear facilities, materials and bombs in a verifiable and irreversible way in exchange for credible security and economic guarantees. Moon said Sunday that the North’s disarmament could be still be a difficult process even if Pyongyang, Washington and Seoul don’t differ over what “complete denuclearization” of the peninsula means.

Moon, who brokered the summit between Washington and Pyongyang, likely used Saturday’s meeting to confirm Kim’s willingness to enter nuclear negotiations with Trump and clarify what steps Kim has in mind in the process of denuclearization, said Hong Min, a senior analyst at Seoul’s Korea Institute for National Unification.

“While Washington and Pyongyang have expressed their hopes for a summit through published statements, Moon has to step up as the mediator because the surest way to set the meeting in stone would be an official confirmation of intent between heads of states,” Hong said.

Some U.S. officials have talked about a comprehensive one-shot deal in which North Korea fully eliminates its nukes first and receives rewards later. But Kim, through two summits with Chinese President Xi Jinping in March and May, has called for a phased and synchronized process in which every action he takes is met with a reciprocal reward from the United States.

Before he canceled the summit, Trump did not rule out an incremental approach that would provide incentives along the way to the North.

Following an unusually provocative 2017 in which his engineers tested a purported thermonuclear warhead and three long-range missiles theoretically capable of striking mainland U.S. cities, Kim has engaged in a flurry of diplomatic activity in recent months. He has had the summits with Moon and Xi, as well as two meetings with U.S. Secretary of State Mike Pompeo.

In addition to the team on North Korea that Pompeo set up last year when he was CIA director, he has now enlisted veteran U.S. diplomat Sung Kim to help in the process, a senior U.S. official said. Kim, who is currently ambassador to the Philippines, also served as ambassador to South Korea and was part of the U.S. negotiating team that last held substantive denuclearization talks with North Korea during the George W. Bush administration in 2005.

Photos released by South Korea’s presidential office showed Moon arriving at the North Korean side of the Panmunjom truce village on Saturday and shaking hands with Kim Jong Un’s sister, Kim Yo Jong, before sitting down with the North Korean leader for their summit.

Moon was accompanied by his spy chief, Suh Hoon, while Kim was joined by Kim Yong Chol, a former military intelligence chief who is now Kim’s top official on inter-Korean relations. The two leaders embraced as Moon departed.

At their first meeting on April 27, Kim and Moon first announced “complete denuclearization of the Korean Peninsula” and permanent peace, which Seoul has tried to sell as a meaningful breakthrough to set up the summit with Trump.

Ahead of that summit, the Koreas established their first-ever leaders’ hotline to enable Moon and Kim to engage in direct communication and defuse crises. But Moon said Sunday that he and Kim decided to meet again, rather than have a telephone conversation, as their aides suggested “candid” face-to-face talks between the leaders.

Relations between the two Koreas had chilled in recent weeks, with North Korea canceling a high-level meeting with Seoul over South Korea’s participation in regular military exercises with the United States and insisting that it will not return to talks unless its grievances are resolved.

South Korea was caught off guard by Trump’s abrupt cancellation of his summit with Kim, with the U.S. president citing hostility in recent North Korean comments. Moon said Trump’s decision left him “perplexed” and was “very regrettable.” He urged Washington and Pyongyang to resolve their differences through “more direct and closer dialogue between their leaders.”

Saturday’s summit marked the fourth meeting between the leaders of the two Koreas since they were divided at the end of the World War II in 1945.

Associated Press writer Kim Tong-hyung contributed to this report.