SEOUL, South Korea — The leader of North Korea, Kim Jong-un, said during a surprise summit meeting that he is determined to meet President Trump and discuss a “complete denuclearization of the Korean Peninsula,” the South Korean president, Moon Jae-in, said on Sunday.

Mr. Kim met unexpectedly with Mr. Moon on Saturday to discuss salvaging a canceled summit meeting between Mr. Kim and Mr. Trump, a new twist in the whirlwind of diplomacy over the fate of the North’s nuclear arsenal. The leaders of the two Koreas met for two hours on the North Korean side of Panmunjom, a “truce village” inside the Demilitarized Zone that separates the two Koreas.

Mr. Moon gave the first details of Saturday’s meeting in a news conference held Sunday morning in Seoul, the South Korean capital. He said that during the meeting, Mr. Kim expressed a desire to “end a history of war and confrontation” on the peninsula. Mr. Kim also said he was willing to talk about getting rid of North Korea’s nuclear weapons, a topic the Trump administration has said was a precondition for a meeting.

Mr. Moon said that Mr. Kim told him he wanted to go though with his planned summit meeting with Mr. Trump, and to make it a success. The Trump-Kim meeting, which would be the first between the heads of state of the United States and North Korea, had been scheduled for June 12 in Singapore, but was abruptly canceled on Thursday by Mr. Trump.

Mr. Trump said he was pulling out of the meeting, citing “tremendous anger and open hostility” from North Korea. But a day later, the American president said he was reconsidering and that it may still take place as scheduled.

Mr. Moon said the biggest challenge to holding the summit meeting was overcoming the lack of trust between North Korea and the United States, two countries that have viewed each other as threats since the end of the Korean War in 1953.

“Chairman Kim once again clearly expressed his firm commitment to a complete denuclearization of the Korean Peninsula,” Mr. Moon said. “What is not so clear to him is how firmly he can trust the United States’ commitment to ending hostile relations and providing security guarantees for his government should it denuclearize.”

Mr. Moon said that North Korea and the United States will soon start working-level talks to help narrow the gap between the two sides. He said the results of those talks will help determine whether a summit between Mr. Kim and Mr. Trump will take place and, if so, whether it will be successful.

Late Saturday night in Washington, Mr. Trump said that discussions about holding the summit meeting after all were “going on very well” and that there was “a lot of good will” between the parties.

Speaking in the Oval Office, the president said that he still hoped to meet with Mr. Kim on June 12 in Singapore, as originally planned.

“A lot of people are working on it,” Mr. Trump said. “It’s moving along very nicely. We’re looking at June 12 in Singapore. That hasn’t changed. And it’s moving along pretty well, so we’ll see what happens.”

Mr. Trump also made a mysterious allusion to talks about the summit meeting that were taking place near the White House on Saturday evening, but he declined to be more specific. It was unclear whether he was referring to the working-level talks mentioned by Mr. Moon.

“As you know, there are meetings going on as we speak in a certain location, which I won’t name,” he said. “But you’d like the location, it’s not so far away from here.”

Video

Foreign journalists were given access to the facility in Punggye-ri, and witnessed the destruction of tunnel entrances and buildings in May. We took a closer look.CreditCreditPool photo, via Reuters

In Seoul on Sunday, Mr. Moon said it was Mr. Kim who proposed the second summit meeting between them, suggesting that the young North Korean dictator is keen for the landmark meeting with Mr. Trump to take place.

During their time together, Mr. Moon said he briefed Mr. Kim on his meeting with Mr. Trump in Washington last week, telling the North Korean leader that the United States was willing to end hostile relations and provide economic cooperation with North Korea should it completely denuclearize.

“Since both Chairman Kim and President Trump want a successful summit, I stressed that the two sides need to communicate directly to remove their misunderstandings and to hold sufficient working-level talks on the agenda for the summit meeting,” Mr. Moon said.

“Chairman Kim agreed,” he added.

It was the second meeting in a month by Mr. Moon and Mr. Kim, who held their first summit meeting on the South Korean side of Panmunjom on April 27. The second meeting, held in secret and announced only after it took place, came amid doubts about the future of Mr. Kim’s planned summit meeting with President Trump.

At Saturday’s meeting, Mr. Kim thanked the South Korean president for his efforts to bring about the summit “and expressed his fixed will on the historic D.P.R.K.-U.S. summit talks,” the North’s official Korean Central News Agency reported, using the abbreviation for the country’s official name, the Democratic People’s Republic of Korea.

The report by the news agency marked the first time North Korea formally acknowledged there was a plan for Mr. Kim to meet Mr. Trump on June 12, and it also appeared to confirm Mr. Kim’s desire to negotiate face-to-face with the American leader.

Mr. Moon’s government has worked for months to help set up the first meeting between the leaders of North Korea and the United States, where it hoped Mr. Kim and Mr. Trump would resolve a decades-old dispute over the North’s nuclear weapons program.

Mr. Trump’s sudden cancellation of the meeting at first appeared to be a blow to Mr. Moon, who had staked much on brokering it. The announcement by Mr. Trump set off a head-spinning series of diplomatic maneuvers aimed at saving the meeting.

North Korea responded to Mr. Trump’s decision with a surprisingly conciliatory gesture, asking Mr. Trump to reconsider and saying that the North was ready to resume dialogue.

For weeks, Mr. Trump had issued a steady stream of enthusiastic comments and Twitter posts on his planned summit with Mr. Kim, although he also warned it might not happen.

Signs of trouble emerged last week, when North Korea pulled out of planned high-level talks with South Korea, protesting a joint military exercise between the South and the United States, which it called a rehearsal for invasion.

The North then focused its anger on Mr. Trump’s hard-line national security adviser, John R. Bolton, who has said the North must abandon its arsenal before sanctions can be lifted, and Vice President Mike Pence, who warned that North Korea might “end like the Libyan model” if Mr. Kim does not denuclearize.

In 2003, Libya’s former leader, Col. Muammar el-Qaddafi, handed over a nascent nuclear weapons program in the hopes of better ties with Washington — only to be killed years later by rebels supported by Washington.

On Thursday, North Korea called Mr. Pence a “political dummy” and warned of a “nuclear-to-nuclear showdown” with the United States, threatening to cancel the summit with Mr. Trump. Hours later, Mr. Trump acted first, canceling it.

On Saturday, the White House announced that an advance team would go as scheduled to Singapore “in order to prepare should the summit take place,” according to Sarah Huckabee Sanders, the White House press secretary.

Michael D. Shear contributed reporting from Washington.

A version of this article appears in print on , on Page A10 of the New York edition with the headline: South Korean Leader Says the North Is Committed to Talks. Order Reprints | Today’s Paper | Subscribe