Moon will face some tough choices as he tries to accomplish two goals, building on a hard-won Olympic détente with North Korea while also preventing a rupture with the Trump administration, which is raising the pressure on the North to give up its nuclear weapons. He also wants to pursue his own agenda of taking a leading role in defusing tensions around the Korean Peninsula, which remains technically at war.

Mr. Moon may see an opportunity in the surprise offer by the North Korean leader, Kim Jong-un, conveyed in person by Mr. Kim’s sister, to hold their first summit meeting in Pyongyang. Mr. Kim seized on Mr. Moon’s peace overtures before the Olympics to send his sister, Kim Yo-jong, to the opening ceremony and a large contingent of cheerleaders and athletes to the Games in Pyeongchang, South Korea.

But Mr. Moon also knows he must convince the Americans to give him a chance. In a sign of how hard that will be, and how deeply the United States and North Korea distrust each other, Mr. Pence, who was Washington’s envoy to the opening ceremony, and Ms. Kim would not even look at each other despite being seated only a few feet apart.

On Friday, Mr. Moon argued for a South Korean-brokered peace and for the United States-North Korea talks when he met with President Trump’s daughter Ivanka Trump, who arrived to attend the Games’ closing ceremony. He told her he wanted to improve ties “in parallel” with efforts to denuclearize the North.

Analysts said that once the Olympics ended, Mr. Moon would be left to sort out how much of the North’s so-called charm offensive, in which it refrained from provocations like missile tests, could last.