The leaders of both Koreas have reason to celebrate as they mark the start of the Lunar New Year ­holiday. 

South Korean President Moon Jae-in has presided over the opening of the Winter Olympics, with all eyes on South Korea as it has put on a dazzling spectacle and hosted a huge North Korean delegation as part of a Games-related rapprochement.

Moon elicited a much-desired invitation to Pyongyang, and he managed to get the Trump administration, which was appearing to lean toward military action, to state an interest in dialogue with North Korea. 

North Korean leader Kim Jong Un is clearly feeling pleased with himself, too. 

The high-level delegation he sent to the South returned home to something of a hero’s welcome, with senior government officials lined up at midnight along a red carpet at Pyongyang’s main airport. 

The following day, the leader’s younger sister and the main interlocutor in the South, Kim Yo Jong, told her brother about the visit before locking arms with him for a photo. Kim Jong Un used words such as “impressive” and “sincere” to describe the way the South’s government had treated the North’s delegation.

“Kim Jong Un has proven that he’s brilliant with the way he’s played this,” said Ralph Cossa, head of the Pacific Forum, a ­Honolulu-based think tank.

Much of the world sees Kim as a cartoonish evil villain, Dr. No crossed with Machiavelli and topped with a bad haircut. But, like his father and grandfather before him, the 34-year-old has defied the geopolitical odds to stay in power. 

At the Opening Ceremonies of the Olympics on Feb. 9, Vice President Pence was seated near Kim Yo Jong, North Korean leader Kim Jong Un’s younger sister. (The Washington Post)

“Kim Jong Un is a cold strategist. He is masterful at playing this game,” said Chun Yung-woo, a South Korean former nuclear negotiator with North Korea and an ardent conservative. “He has won every bet he’s made in the last six years. I wouldn’t underestimate him.”

Even as they isolate and repress the 25 million-strong population, North Korea’s leaders are well versed in what is happening in the outside world, especially in Washington.

Officials dissect President Trump’s tweets. They watch CNN constantly. They have read “Fire and Fury,” Michael Wolff’s book about the Trump White House. 

Many analysts think that the North Korean leader has become alarmed about talk in Washington of military options for dealing with his regime and has become worried that sanctions will cripple his economy.

For that reason, he took up Moon’s invitation to the Olympics as a face-saving way out of the cycle of escalation. He sent a huge contingent of cheerleaders and musicians, and even a few athletes. 

He also sent his younger sister, who is the propaganda chief in North Korea and is under U.S. sanctions tied to human rights abuses. Another member of the delegation is blacklisted by the United States and the United Nations. South Korea got a special waiver for him to travel.

“He’s adopted ‘maximum charm’ to counteract ‘maximum pressure,’ ” Chun said, referring to Kim’s response to the Trump administration’s strategy to squeeze Pyongyang. “And he’s been successful. He’s fooled these naive leaders who are eager to engage North Korea.”

Moon has portrayed the inter-Korean detente as a step toward broader nuclear negotiations, although Pyongyang has dismissed any such idea, saying its nuclear program has nothing to do with Seoul.

For progressive South Korean leaders who favor a “sunshine policy” engagement with North Korea, a summit in Pyongyang is the holy grail. Kim Dae-jung won the Nobel Peace Prize after brokering the first inter-Korean summit in 2000, although the effort was marred when it was discovered his government paid $500 million for the privilege, and Kim Dae-jung’s ideological heir, Roh Moo-hyun, traveled to the North for his own summit meeting in 2007.

North Korean leader Kim Jong Un invited South Korean President Moon Jae-in to Pyongyang. The invitation was delivered by Kim Jong Un's sister, Kim Yo Jong. (Reuters)

Both of them met Kim Jong Il, the current leader’s father.

Now, Moon looks to be in line to get his own meeting, but this time with the third-generation leader, Kim Jong Un. It would be the first time in his six years in power that Kim has met a foreign leader.

But like his predecessors, Moon would have to travel to the North for the meeting. Although Kim is not afraid of flying, as his father was, the young leader has not left the country since he took control at the end of 2011.

Several South Korean polls published Thursday put public support for the rapprochement at between 60 and 70 percent. The South Korean president used the Lunar New Year celebrations to keep the momentum going.

“South and North Korean athletes are exchanging warm greetings in Korean with each other,” Moon said in a video message on the eve of the holiday. “This is a long-awaited scene for Koreans’ most festive traditional holiday.”  

Next week, once officials return from their holiday break, they will get down to the serious business of trying to arrange the summit.

The South Korean government is talking about sending a special envoy to Pyongyang to start making arrangements for the meeting. Moon has plenty of experienced candidates to choose from — his chief of staff, unification minister and intelligence chief were all involved in the previous summits. 

After a year of threats, actual and rhetorical, fired from North Korea toward the United States, the sudden burst of inter-Korean diplomacy has turned the focus away from Washington, at least temporarily. 

“It really does look like the U.S. is not in the driver’s seat anymore,” said Bridget Coggins, a Korea specialist at the University of California at Santa Barbara. “The United States doesn’t seem like a coherent actor at the moment, so maybe it’s just better to wait and see what happens.”

Moon was careful, upon receiving the invitation to Pyongyang, not to appear too eager. He said the countries needed to “work towards creating the right conditions” for the summit and urged North Korea to talk to the United States, his spokesman said. 

But there is still a great deal of skepticism in Washington about Moon, whose parents fled North Korea as refugees during the war and who has repeatedly talked of wanting to visit the North.

Trump “has made it clear he always believes in talking,” Vice President Pence told Axios after returning from South Korea. “But talking is not negotiation — talking is understanding one another.”

Trump and Japanese Prime Minister Shinzo Abe, a staunch supporter of Trump’s who has repeatedly warned Moon not to fall for North Korea’s “smile diplomacy,” spoke on the phone Wednesday and remain deeply wary, but analysts say there is value in talks with North Korea.

“If you’re talking, you can make policies clear and also make the consequences clear,” Coggins said. “The U.S. side has been really bad on that dimension.” 

Research by the Beyond Parallel team at the Center for Strategic and International Studies has found that over a 25-year period, North Korea has been much less likely to conduct missile tests or stage other provocations while ­involved in diplomacy with the United States.

At a hearing in Washington this week, Director of National Intelligence Daniel Coats wondered whether the North Korean leader was getting good advice from his inner circle.

Cossa, who often meets North Korean diplomats for unofficial talks, said that if Moon can talk directly to Kim and spell out the risks involved with continuing to pursue his nuclear weapons program, that could drive home the United States’ message.

“There would be great value in Moon looking Kim in the eye and saying, ‘You need to talk about the nuclear issue,’ ” he said.

There is not, however, a great deal of confidence in the United States that Moon will coordinate closely with the Trump administration and deliver that tough message, Cossa said.

But Paik Hak-soon, a North Korea specialist at the Sejong Institute, a think tank outside Seoul, said Moon was using the opportunity of an inter-Korean summit to make progress on the nuclear problem.

“Some people say North Korea is trying to drive a wedge between South Korea and the United States, but that’s not true,” said Paik, an advocate of engagement with North Korea. “Kim Jong Un was trying to use the Olympics to talk to the United States. The U.S. should see this inter-Korean development not as an obstacle to the pursuit of its objectives but as a way to help achieve those objectives.”