Fourth inter-Korean summit in history was aimed at discussing a possible meeting between Kim and President Donald Trump

South Korean President Moon Jae-in and North Korean leader Kim Jong Un held a surprise meeting at the demilitarized zone Saturday aimed at keeping inter-Korean relations, and a possible summit between Mr. Kim and President Donald Trump, on track.

South Korea’s presidential office announced the two-hour meeting after it had wrapped up, saying the two leaders met on the north side of the demilitarized zone and discussed how to successfully stage a summit between Messrs. Trump and Kim.

The meeting—the fourth in history between leaders of the two Koreas—was the latest dramatic turn in a series of diplomatic maneuvers as the U.S. and South Korea seek to rein in North Korea’s nuclear ambitions.

It followed an April 27 summit between Messrs. Moon and Kim on the south side of the line dividing the inter-Korean truce village of Panmunjom, at which the two men signed a Panmunjom Declaration vowing an end to war and hostilities between the two sides.

It also came days after Mr. Trump abruptly scrapped a planned summit with Mr. Kim in Singapore on June 12—only to say a day later that it might still take place.

White House Press Secretary Sarah Sanders said Saturday that a team that travels in advance to iron out details for official trips would depart for Singapore on Sunday to prepare should the summit take place.

Photos and video released by the presidential Blue House on Saturday showed Mr. Moon in a bear hug with Mr. Kim, and of the two men wearing broad grins as they shook hands. They met at Unification Pavilion, a building on the north side of the military demarcation line, the South said.

Other photos showed Mr. Moon being greeted by Mr. Kim’s younger sister, Kim Yo Jong, and of the South Korean leader sitting across a table with Mr. Kim and Kim Yong Chol, a four-star North Korean general who has been a constant presence at his leader’s side in recent weeks. Mr. Moon was accompanied by Suh Hoon, the South’s spy chief.

Mr. Moon will share the details of the inter-Korean meeting Sunday at 10 a.m. Seoul time, said Yoon Young-chan, a spokesman for South Korea’s presidential office, in a statement Saturday evening.

The meeting was the second between Messrs. Moon and Kim in as many months, and the fourth in history between the leaders of the two Koreas. Kim Jong Un’s father, Kim Jong Il, met with South Korea’s presidents in 2000 and 2007, both times in Pyongyang.

Saturday’s summit showed that Messrs. Kim and Moon are both eager to keep the diplomatic momentum going despite recent setbacks, said Markus Bell, a lecturer in Korean and Japanese studies at the University of Sheffield in the U.K.

“ Donald Trump has been flip-flopping on whether he’s going to get involved and move forward on a summit, and he’s given the window for North Korea to look like the levelheaded, rational actor,” Mr. Bell said.

South Korean President Moon Jae-in, left, shakes hands with Kim Jong Un oin Saturday.
South Korean President Moon Jae-in, left, shakes hands with Kim Jong Un oin Saturday. Photo: Agence France-Presse/Getty Images

Jenny Town, a research analyst at the Stimson Center think tank in Washington and managing editor of 38 North, a North Korea-focused blog, said Mr. Moon’s ability to hold a snap meeting with Mr. Kim highlights the willingness of both leaders to engage in back-channel diplomacy.

“They feel comfortable enough to have direct communication and to be able to meet on short notice,” Ms. Town said, adding that the body language between them underscored that.

Mr. Kim greeted Mr. Moon, she said, “like an old friend, instead of an awkward handshake.”

Mr. Moon had been a chief proponent of direct talks between Washington and Pyongyang, and said he was “perplexed” by Mr. Trump’s cancellation of the meeting.

Go Myong-Hyun of the Asan Institute for Policy Studies, a private think tank in Seoul, said the two Korean leaders may also have been motivated by an attempt to stave off a return to U.S.-led pressure and sanctions against Pyongyang, as Mr. Trump said this week.

“The ultimate goal of this summit was to ensure that ‘maximum pressure’ doesn’t surface again in Washington after the cancellation of the U.S.-North Korea summit,” Mr. Go said.

Mr. Moon, eager to keep talks on track, was able to draw on his historically high domestic approval ratings to continue to push things forward with the North, even in the face of Mr. Trump’s calls for a return to “maximum pressure,” Mr. Bell said.

“Moon has positioned himself as the peacemaker, and he’s riding the wave of 80% approval to basically push forward his agenda to reach out to North Korea,” he said.

The message from Messrs. Moon and Kim, he added, was: “Why do we need the U.S. doing anything if Trump is going to oscillate between ‘fire and fury’ and sharing a hamburger with Kim? Maybe we should move things forward by ourselves.”

Write to Jonathan Cheng at