Updated at 9:42 a.m. ET

The leaders of North and South Korea pledged Friday to remove all nuclear weapons from their peninsula and vowed to work toward an official end to the Korean War.

The meeting between Kim Jong Un and South Korean President Moon Jae In contained many firsts: Kim became the first North Korean leader to ever step inside the South. And in an apparently unscripted moment, the North Korean leader invited Moon to step across the demarcation line that divides their two countries. They did so together, holding hands, and then stepped back into South Korea.

“South and North Korea confirmed the common goal of realizing, through complete denuclearization, a nuclear-free Korean Peninsula,” a statement signed by the two leaders said following the meeting at the border village of Panmunjom.

Even more surprising was a remark from Kim, who said:  “I came here to put an end to the history of confrontation.”

Such a scenario was unimaginable just a few months ago. Even as U.S. officials expressed an impatience for North Korea’s total, unilateral denuclearization, Moon recently cautioned his aides against “an excessive eagerness to try to fix all problems at once.”

The summit, which took place on the South Korean side of the joint security area in Panmunjom, the iconic village straddling the border between North and South Korea, was the first meeting between the two countries’ leaders since 2007. In October of that year, then–South Korean President Roh Moo Hyun crossed the military line of demarcation on foot into North Korea, where he was greeted by the North Korean leader Kim Jong Il. This Friday, Kim, his son, crossed the border to the South. Photographs show the two leaders chatting on a leisurely walk along one of the world’s most heavily fortified borders.

(Korea Summit Peace Pool / Reuters)

It was a sharp departure from the tone of barely a year ago, when news reports from the peninsula tended to reference “heightened tension.” At the time, Kim was accelerating the pace of his nuclear and missile testing while President Trump lobbed threats back in his direction. But the mood shifted suddenly with the Korean Olympics and Trump’s promise of a U.S.–North Korean summit meeting. In the interim, the tantalizing possibility of peace is one that Moon campaigned on, and the inter-Korean summit was an important test of that promise on a major stage.

For Moon, the question now is what he will do with the movement toward a peace treaty to formally end the Korean War—stopped but not technically concluded by an armistice in 1953—and, consequently, how he can help set the conditions for Kim to conclude some kind of denuclearization deal when he meets with Trump in the coming months. The two leaders’ joint statement referenced only the “common goal” of peace and a denuclearized Korean peninsula; it did not actually establish either of these things.

Both would require other international actors. As Moon said at a recent meeting with an advisory committee of veteran North Korea negotiators and policymakers, “It has become the case that improving the relationship between North and South Korea cannot just be achieved by agreement between the two countries, but requires the fulfillment of a denuclearization agreement between the United States and North Korea.”

The sequencing is important. Experts told me that North Korea seeks essentially the reverse—that it may be willing to give up its nuclear weapons in exchange for a peace treaty, which Pyongyang would see as a safeguard against U.S. military aggression. But even that is not something the two Koreas can achieve on their own. “In order for the peace treaty to be an effective safeguard that can prevent U.S. military action against North Korea, there needs to be more than a two-party deal,” Jeong Se Hyun, South Korea’s unification minister from 2002 to 2004 and a former envoy to North Korea, told me. “China needs to be a signatory, in addition to the United States, South Korea, and North Korea,” all of whom, with the exception of South Korea, are signatories to the current armistice. “With that mechanism protecting North Korea from U.S. aggression, North Korea will then likely agree to surrender their nuclear weapons.”

It sounds simple enough in theory, but there’s a reason this exchange hasn’t occurred before. The real challenge will be to work out a deal that guarantees enforceable and verifiable denuclearization in clear steps, at an acceptable price to the U.S.—which keeps over 20,000 troops in South Korea. The North has long insisted that they leave, and the U.S. has long maintained that their presence is not negotiable. South Korea recently announced that the North had dropped this demand, a seeming concession that was greeted by some in Washington as a ploy. Thus even the seeming breakthrough announcement from the summit leaves plenty of complications in its wake.

“South Korea and North Korea can’t do much beyond affirming the basic agreement that North and South Korea will work together closely in order to achieve complete denuclearization,” Jeong said ahead of the summit. This was confirmed on Friday. “The various things North Korea wants in return for denuclearization—counterpayments, diplomatic treaties—are things South Korea can’t decide on their own.”

Seoul is aware of these limitations, which is why President Moon has called for his administration to assume the role of a “guide” and facilitator for the United States in the current summit. “You could say that the role of this summit is to lay the groundwork for the upcoming summit between United States and North Korea,” Cheong Seong Chang, the director of the Department of Unification Strategy Studies at the Sejong Institute, a think tank, and a summit policy advisor to the Ministry of Unification, said.

Still, while Moon and Kim’s joint statement is couched in broad and cautious language affirming cooperative intent, it will nonetheless play an important role in clarifying the terms of denuclearization underpinning the later summit meeting between Trump and Kim.

And it represents a meaningful milestone for South Korea. In navigating the unorthodoxy and volatility of the Trump administration, while juggling sports diplomacy and sanctions against the North, Moon has already demonstrated a deft diplomatic touch. The recent establishment of a direct hotline between Moon and Kim bodes well for South Korea’s role as mediator, while Moon’s acknowledgement of Japan’s requests has opened the door to a Japan–North Korea summit down the road. With North Korea yet to make any binding commitments, it may be too early to celebrate these efforts, but by the same token, it is also too early to dismiss them.