The leaders of North and South Korea agreed Friday to pursue a permanent peace and the complete denuclearisation of the divided peninsula, as they embraced after a historic summit laden with symbolism.
In a day of bonhomie including a highly symbolic handshake over the Military Demarcation Line that divides the two countries, the pair issued a declaration on "the common goal of realising, through complete denuclearisation, a nuclear-free Korean peninsula".
Upon signing the document, the two leaders shared a warm embrace, the culmination of a summit filled with smiles and displays of friendship in front of the world's media.
They also agreed that they would this year seek a permanent end to the Korean War, 65 years after the hostilities ended in an armistice rather than a peace treaty.
Moon would visit Pyongyang in "the fall", the two leaders said, also agreeing to hold "regular meetings and direct telephone conversations".
The so-called Panmunjom Declaration capped an extraordinary day unthinkable only months ago, as the nuclear-armed North carried out a series of missile launches and its sixth atomic blast.
Kim said he was "filled with emotion" after stepping over the concrete blocks into the South, making him the first North Korean leader to set foot there since the shooting stopped in the Korean War.
At Kim's impromptu invitation the two men briefly crossed hand-in-hand into the North before walking to the Peace House building on the southern side of the truce village of Panmunjom for the summit — only the third of its kind since hostilities ceased in 1953.
"I came here determined to send a starting signal at the threshold of a new history," said Kim.
After the summit, he pledged that the two Koreas will ensure they did not "repeat the unfortunate history in which past inter-Korea agreements... fizzled out after beginning".
The two previous Korean summits in 2000 and 2007, both of them in Pyongyang, also ended with displays of affection and similar pledges, but the agreements ultimately came to naught.
With the North's atomic arsenal high on the agenda, South Korean President Moon Jae-in responded that the North's announced moratorium on nuclear testing and long-range missile launches was "very significant."
It was the highest-level encounter yet in a whirlwind of nuclear diplomacy, and intended to pave the way for a much-anticipated encounter between Kim and US President Donald Trump.
Last year Pyongyang carried out its sixth nuclear blast, by far its most powerful to date, and launched missiles capable of reaching the US mainland.
Its actions sent tensions soaring as Kim and Trump traded personal insults and threats of war.
Moon seized on the South's Winter Olympics as an opportunity to broker dialogue between them, and has said his meeting with Kim will serve to set up the summit between Pyongyang and Washington.
The White House said it hoped the summit would "achieve progress toward a future of peace and prosperity for the entire Korean Peninsula".
Trump has demanded the North give up its weapons, and Washington is pressing for it to do so in a complete, verifiable and irreversible way.
Seoul had played down expectations before the summit, saying the North's technological advances in its nuclear and missile programmes made the summit "all the more difficult".
Pyongyang is demanding as yet unspecified security guarantees to discuss its arsenal.
When Kim visited the North's key backer Beijing last month in only his first foreign trip as leader, China's state media cited him as saying that the issue could be resolved, as long as Seoul and Washington take "progressive and synchronous measures for the realisation of peace".
In the past, North Korean support for denuclearisation of the "Korean peninsula" has been code for the removal of US troops from the South and the end of its nuclear umbrella over its security ally — prospects unthinkable in Washington.
Moon said he hoped they would have further meetings on both sides of the border, and Kim offered to visit Seoul "any time" he was invited.
After a morning session lasting an hour and 40 minutes, Kim crossed back to the North for lunch, a dozen security guards jogging alongside his limousine.
Before the afternoon session, Moon and Kim held a symbolic tree planting ceremony on the demarcation line.
The soil came from Mount Paektu, on the North's border with China, and Mount Halla, on the South's southern island of Jeju.
After signing the agreement the leaders and their wives attended a banquet before Kim was to return to the North.