President Moon Jae-in returns home Thursday from a three-day visit to Pyongyang, the highlight of which were his discussions with North Korean leader Kim Jong-un about denuclearization and improved inter-Korean relations. Overall, the trip appears to have been a success.

One successful element was that Moon drew Kim into agreement to take additional denuclearization steps, which could help revive the stalled talks between the US and the North. Trump made a positive response to the agreement in a tweet, saying, “Kim Jong-un has agreed to allow nuclear inspections, subject to final negotiations, and to permanently dismantle a test site and launch pad in the presence of international experts.”

A joint statement issued after their second round of summit talks Wednesday said that the North has agreed to permanently shut down its missile engine testing facility and launch pad in the presence of international experts. It also expressed its willingness to permanently shut down its key nuclear facility in Yongbyon pending corresponding steps by the US.

As Moon noted in a post-summit joint news conference with Kim, it marked the first time that Kim stated denuclearization actions in a joint statement with Moon. These may well be positive developments, although the agreement falls short of the US demand that Pyongyang provide an inventory of its nuclear materials and facilities and open them to international inspection.

Now, based on his agreements and discussions with Kim, Moon faces the challenge of fulfilling his role as a mediator between the US and the North when he meets Trump in New York on the sidelines of the annual UN General Assembly next week.

The key point is how Moon can narrow their differences and how he will achieve his goal of getting both leaders, and possibly Chinese President Xi Jinping as well, to agree to a formal end to the Korean War, which ended only with an armistice agreement in 1953.

Aside from the denuclearization issue, Moon and Kim have achieved some meaningful progress in building mutual trust and reducing military tensions between the two sides.

After their first meeting in April, the two sides ceased propaganda broadcasts along the border and restored emergency telephone lines between their military authorities. The two Koreas also opened a joint liaison office in the North Korean border city of Kaesong last week. All were follow-up actions to the Panmunjom Declaration the two leaders signed in April.

New tension-reducing measures taken by Moon and Kim go far beyond expectations. Most of all, they agreed to take sweeping steps to prevent armed conflict between the two sides, with details stated in a separate agreement signed by their defense ministers.

The agreement includes the establishment of a joint military committee, which will oversee tension-reducing measures including the suspension of military drills in the border area, withdrawal of guard posts from the Demilitarized Zone, disarming the Joint Security Area that houses Panmunjom and jointly excavating the remains of servicemen who died in the DMZ area during the Korean War. The two sides agreed to designate a “maritime peace zone” in the West Sea and expand the no-fly zone in the airspace.

Other reconciliation and trust-building measures, such as reconnection of roads and railways, establishment of a rendezvous facility for reunions of separated families and sports and cultural exchange programs, also should not be undervalued. Additionally welcome was Kim’s acceptance of Moon’s invitation to visit Seoul in the near future, which Moon said could be within this year.

During his stay in Pyongyang, Moon appeared elated and upbeat over how his discussion with Kim went and the enthusiastic welcome he received from the North, including the huge turnout of Pyongyang citizens who waved flags and flowers on the streets, and other festivities.

The way Kim and his wife, Ri Sol-ju, received and entertained Moon and first lady Kim Jung-sook also showed that the current leader is more open and friendly than his reclusive forefathers.

But the positive aspects of Moon’s three-day visit to Pyongyang will turn out to be meaningless if both leaders, along with Trump, fail to move the denuclearization work forward in the coming months. As Moon said before his departure for Pyongyang, peace on the peninsula should be eternal and irreversible, and it is obvious what the three main players must do to achieve that goal.