President Donald Trump’s Thursday morning decision to cancel the summit with North Korean leader Kim Jong Un came as a surprise to many — including South Korea.

The Washington Post’s Anna Fifield reported that South Korean President Moon Jae-in’s administration clearly didn’t know about Trump’s plans to call the meeting off.

“We are attempting to make sense of what, precisely, President Trump means,” Kim Eui-kyeom, a spokesperson for the president, said on Thursday after the White House released Trump’s letter canceling the summit. Moon called a midnight meeting to figure out what to do next.

That’s astounding. South Korea, of course, is a staunch US ally. Seoul and Washington stay in very close contact when it comes to security dilemmas in Northeast Asia, and especially on matters relating to North Korea.

But what makes matters worse is that Moon was personally invested in a Trump-Kim summit. He and his administration worked tirelessly to make it happen in hopes that Washington and Pyongyang could agree on the future of North Korea’s nuclear program. Of course, part of his motivation to do this was to protect South Koreans from Pyongyang’s nuclear arsenal.

Moon even held his own historic summit with Kim in April to set the table for when Trump met with the North Korean leader.

It also doesn’t help that Moon traveled to the White House on Tuesday — only 48 hours before Trump canceled the Kim meeting — solely to convince Trump that meeting with Kim was still worth it, experts told me. But apparently Trump didn’t give Moon any indication that he was seriously considering scrapping the summit — leaving the South Korean government completely in the dark.

There’s no way around it: This is all bad news for Moon.

“Trump’s abrupt cancelation is a slap in the face to South Korean President Moon Jae-in,” says Zhiqun Zhu, an East Asian politics expert at Bucknell University. “He put huge stakes on the Trump-Kim meeting, and now he has to deal with the consequences.”

But Trump’s decision also has major — and mostly negative — ramifications for one of America’s strongest relationships in Asia. “In the short term, US-South Korea relations will enter a cooling period, which is unfortunate because a resolution to the North Korean nuclear issue requires a strong alliance,” Zhu continued. “Trump has some work cut out for him to shore up relations with Moon and maintain the alliance.”

That’s the issue: Not only does Trump have to work hard to improve ties with North Korea, he now has to redouble his efforts just to improve Washington-Seoul relations again.

What does South Korea do now?

Joshua Pollack, a nuclear and Northeast Asia expert at the at the Middlebury Institute of International Studies, told me that the South Korean president is backed into a corner. “I don’t know if Moon has any alternative at this point but to try somehow to salvage this wreck,” he said.

Moon’s first problem is domestic: He has local elections to deal with on June 13. He currently enjoys sky-high approval ratings that hover around 75 percent, but much of that enthusiasm stems from his recent success in calming tensions with North Korea. Now that Trump has defied him, Moon may need to scramble to ensure his liberal political party doesn’t lose votes.

Trump should be seriously concerned about that possibility: If Moon loses tons of support at home, that could hurt his flexibility to work closely with the White House on dismantling North Korea’s nuclear program.

There’s also a larger geopolitical concern, experts told me: China may take advantage of this temporary break in US-South Korea relations to draw Seoul closer to Beijing. “That would be terrible for the US and a disastrous consequence for US global leadership,” Mieke Eoyang, a national security expert at the centrist Third Way think tank, told me.

Wooing South Korea is something China has long tried to do. If Beijing succeeds in doing that, China strengthens its position by gaining an ally in Northeast Asia while wresting a major friend away from the US. Moon has so far resisted Chinese leader Xi Jinping’s push to greatly improve Sino-South Korean ties — but that could all change after Trump’s decision to cancel the summit on Thursday.

Of course, Moon may continue to work with Trump on North Korea. And Moon still has a hotline to Kim, so both Korean leaders can continue to chat without an American middle man.

But experts tell me Moon will likely find that achieving his ultimate goal — a denuclearized North Korea, a peaceful Korean Peninsula, and an unbreakable bond between Seoul and Washington — will be harder than ever. “It will be an uphill battle at this point,” Pollack told me. “He has to know that.”