On Tuesday, March 27, an armored train transported a number of high-level North Korean officials to Beijing for a secretive visit—a delegation that included Kim Jong-un himself. This is a major turn of events as Kim has never traveled outside his hermit kingdom since becoming its leader in 2011, nor has he met with another head of state. Though China did confirm Kim’s presence in Beijing after he left, we still have no insight into who initiated the visit and what was discussed.

One thing is certain, however: this visit was a desperate—but strategic—move designed to improve Kim’s position in any future negotiations with the United States.

Kim needs Beijing on his side if North Korea is going to achieve its goals at the negotiating table. However, Beijing’s support is not a given. As I wrote in Foreign Affairs, the China–North Korea relationship has deteriorated in recent years. Beijing’s efforts to distance itself from Pyongyang enjoys wide public support. Xi is said to despise the North Korean regime, and he has publicly stated that China will not protect North Korea if Kim provokes a conflict. In fact, the bilateral relationship has gotten so bad that officers in the People’s Liberation Army have suggested to me in private meetings that Beijing and Pyongyang may not take the same side in the event of a new Korean war. Such a historical trip may demonstrate Kim’s willingness to finally heed Beijing’s advice, which would go a long way to improve strained relations.

Having Beijing on his side would work to Kim’s advantage in a number of ways. First, based on past negotiating patterns, Kim is likely to ask for the easing of sanctions and even some positive economic inducements just to stay involved in the diplomatic process. The United States, however, will be resistant to this, given its opposition to the economic benefits that were a part of the Iran deal, coupled with National Security Advisor–designate John Bolton’s comments that meeting President Trump should be enough of a reward.

Historically, Beijing has been supportive of easing sanctions if it keeps North Korea talking; China is a big piece of the equation, seeing that it is responsible for 90 percent of North Korea’s trade with the outside world. If China is so inclined, it could unilaterally provide sanctions relief, or even convince the United States to soften its attempts at isolating Pyongyang.

Beyond economics, Pyongyang likely got wind that the United States was pushing China to openly discuss contingencies on the Korean Peninsula to deconflict potential operations—and that Beijing was becoming more receptive. China has also carried out a number of exercises that suggest it is actively preparing for a Korean contingency. Since 2015, the majority of Chinese naval drills have taken place in the Bohai and Yellow Seas, off the coast of North Korea and Japan, including three known major exercises in the waters close to North Korea. In September 2017, two days after North Korea’s fifth nuclear test, land and air force personnel conducted exercises while China’s strategic rocket force practiced shooting down incoming missiles over the waters close to North Korea. According to a Chinese naval expert, these exercises show that “China is prepared and able to stop any power that threatens stability in the region.”

If war breaks out on the peninsula, but China does not intervene to protect North Korea and collaborates in the aftermath with the United States, that would mean the end of Kim. In short, the stakes are high, and Kim needs to be in a position to play the two countries off each other. Engaging directly with both sides will help him do that.

But is a short visit to Beijing enough? It is hard to know China’s response; media outlets were banned Tuesday from reporting on North Korea at all and terms such as “North Korea,” “Kim Jong-un” and “Fatty the Third” were completely censored from Weibo, China’s largest social media platform.

China and its leaders are not amateurs when it comes to dealing with the North Korean regime. While Kim’s willingness to leave Pyongyang to go to China’s capital goes a long way to demonstrate his desire for improved relations, Beijing likely has some demands of its own. Xi probably chastised Kim for his provocative behavior, and warned him not to engage in any more nuclear or missile tests under any circumstances. China may even push for domestic political and economic changes within North Korea, or more access and influence with the regime, especially in the context of negotiations with the United States. In other words, if Xi is going to help Kim, China can’t merely be notified of Kim’s decisions—it has to be able to drive them.

Additionally, China needs to make sure that Kim is prepared to negotiate in good faith. If this is merely a stalling tactic until Kim completes his nuclear deterrent, there are concerns that this could be the last straw for the Trump administration, making war on the peninsula all but imminent. This is an outcome that Beijing is hoping to avoid if possible.

At the very least, Beijing just won itself a seat at the table. While North Korea and the United States will be vying for the upper hand, the ultimate winner will be Beijing. China is in the best position among all three to drive events in its favor, and to ensure that there is no war and no collapse. Perhaps most importantly, China’s involvement can ensure that the United States continues to focus on the Korea nuclear issue, thus failing to compete with Beijing for regional power, and perhaps even global influence.

Oriana Skylar Mastro is an assistant professor of security studies at Georgetown University and a Jeane Kirkpatrick Scholar at the American Enterprise Institute. Her research and commentary can be found at orianaskylarmastro.com.

Image: North Korean leader Kim Jong Un and wife Ri Sol Ju pose for a picture with Chinese President Xi Jinping and wife Peng Liyuan at the Great Hall of the People in Beijing, China in this picture released to Reuters on March 28, 2018. Ju Peng/Xinhua via REUTERS​