SEOUL, South Korea — South Korea's president says that North Korean leader Kim Jong Un committed to sitting down with President Donald Trump and to a “complete denuclearization of the Korean Peninsula” during a surprise meeting in the Demilitarized Zone on Saturday.

South Korean President Moon Jae-in and Kim met Saturday hours after Trump suggested his June 12 summit with Kim may still go ahead.

"Chairman Kim made clear once again his intentions to completely denuclearize the Korean Peninsula as he did in the Panmunjeom Declaration," President Moon said in a statement Sunday local time, according to an NBC News translation, referring to the agreement the two leaders signed when they first met at the border last month.

Saturday's surprise talks between the rival Koreas — which Moon said Kim requested — came hours after Trump told reporters that the planned June 12 summit in Singapore, which he abruptly canceled this week, might still be salvaged.

An angry Trump personally dictated a letter to Kim on Thursday.The president, fearing that the North Koreans might beat him to the punch, wanted to be the one to cancel first, multiple officials told NBC News.

The letter set off a whirlwind 48 hours of diplomatic back-and-forth.

Trump said Saturday during a meeting at the Oval Office that "we’re doing very well in terms of the summit with North Korea," and that "I think there's a lot of goodwill."

"It's moving along very nicely, so we're looking at June 12th in Singapore; that hasn't changed," Trump said. "And it's moving along pretty well. So we'll see what happens."

State Department spokesperson Heather Nauert said in a statement Sunday that "a U.S. delegation is in ongoing talks with North Korean officials at Panmunjom [North Korea]. We continue to prepare for a meeting between the President and North Korean leader Kim Jong Un."

We are having very productive talks with North Korea about reinstating the Summit which, if it does happen, will likely remain in Singapore on the same date, June 12th., and, if necessary, will be extended beyond that date. — Donald J. Trump (@realDonaldTrump) May 26, 2018

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

Moon told reporters after Sunday's briefing that "The real issue for the Chairman Kim is not his firm determination for the complete denuclearization. Chairman Kim is worried about whether he can trust that the U.S. will end the policy of hostility and guarantee the stability of his regime" after denuclearization.

Moon said the Trump administration has indicated the United States is willing to possibly offer economic assistance after denuclearization.

"I have delivered what each party has in mind and am now urging the both parties to confirm each other's posture directly," Moon said.

He also suggested that if a Trump-Kim summit does take place and is a success, the parties should move to three-way talks in order to formally end the Korean War.

Kim and Moon met for two hours on the North Korean side of the truce village Panmunjom between 3 p.m. and 5 p.m. local time (2:00 a.m. to 4:00 a.m. ET), according to the Blue House, which released pictures of the two leaders embracing.

North Korean leader Kim Jong Un and South Korean President Moon Jae-in. South Korean Presidential Office via Twitter

"The two leaders exchanged views frankly in order to make the U.S.-N.K. summit talks happen successfully and to carry out the 4.27 Panmunjeom Declaration," said Yoon Young Chan, a presidential spokesman, referring to the agreement signed after last month's historic talks.

North Korean state-run media KCNA said in its own statement about the Saturday meeting that Kim and Moon expressed "their stand to make joint efforts for the denuclearization of the Korean peninsula."

Meanwhile China said it is still looking forward to "a successful and timely summit" between Trump and Kim, "bringing peace to the peninsula and bringing good news to the world," Foreign Ministry spokesperson Lu Kang told NBC News.

Last month's summit marked the first meeting between North and South Korean leaders in a decade. During the talks Kim and Moon pledged "no more war," as well as the common goal of the "complete denuclearization" of the Korean Peninsula.

The detente on the Korean Peninsula came as the North Korean leader engaged with Trump over their nuclear arsenal. After a year of fiery rhetoric the two leaders agreed to meet in Singapore next month in what would be a historic summit.

But the White House stunned the world Thursday by canceling the meeting 18 days before it was due to take place and by warning that the U.S. military is prepared to act.

Trump blamed the cancellation on the "tremendous anger and open hostility" in a recent statement by the North Koreans. The president appeared to be referring to a statement by Pyongyang on Thursday that warned of a "nuclear-to-nuclear showdown" with the United States.

The North Koreans were reacting to comments by Vice President Mike Pence suggesting that the rogue state could face a fate similar to that of Libya, where former leader Muammar Qaddafi was deposed and killed after agreeing to dispose of his nuclear weapons.

North Korea called the vice president a "political dummy" for the remark.

However, Pyongyang said its rhetoric was tit-for-tat and that they were still willing to "sit down any time and in any way to solve the problem."

Stella Kim reported from Seoul and Saphora Smith reported from London.