Earlier this week, North Korean leader Kim Jong-un traveled to Beijing to meet Chinese leader Xi Jinping, making his first trip outside of country since he assumed power in late 2011. During the secretly guarded visit, Kim reportedly expressed his commitment to the denuclearisation on the Korean Peninsula if the conditions are right.

According to China’s state-run news agency Xinhua, Kim expressed that; “the issue of denuclearisation of the Korean Peninsula can be resolved, if South Korea and the United States respond to our efforts with goodwill, create an atmosphere of peace and stability while taking progressive and synchronous measures for the realisation of peace.” Meanwhile Xi extolled the importance of historic bond between China and North Korea and accepted Kim’s invitation to visit Pyongyang in the coming months.

Kim’s visit to China is the latest in the rapid succession of recent developments on the Korean Peninsula which has been dizzying. First, there were the series of diplomatic exchanges between South and North Korea during and after the Winter Olympic Games in Pyeongchang. These steps culminated in an historic meeting between senior South Korean officials in Pyongyang with Kim Jong-un in early March. During that meeting, the two sides agreed to an inter-Koreas summit – now scheduled for late April. At the visit of South Korea envoys to Pyongyang, Kim also reportedly indicated his desire to meet directly with US President Donald Trump and floated an apparent willingness to discuss the denuclearisation of the North’s nuclear weapons programme. The proposal was quickly accepted by Trump, despite the council of allies and White House advisers for a more cautious approach, and there are now tentative plans to host a summit between Trump and Kim sometime before the end of May.

{articleGUID}

Amidst this backdrop, Kim’s visit to China adds an important wrinkle to a complex and fluid situation on the Korean Peninsula. There are several important takeaways from the visit. First, the move is a diplomatic coup for both sides in different ways. For North Korea, the visit signifies a mending of ties with China – its historic partner and ally – after years of strained relations due to Pyongyang’s persistent development of its nuclear weapons programme. After years of struggling to secure a meeting with China’s top leadership, Kim has now elevated his image to the status of equal with his warm and extended welcome in Beijing (which was just short of an official state visit status).

But perhaps more importantly, Pyongyang has now secured itself an important insurance card by shoring up its relations with Beijing. The move both increases leverage for Kim ahead of his upcoming summit with South Korean President Moon Jae-in and his potential meeting subsequently with Trump. This move is especially important for Kim in light of the recent flurry of changes to Trump’s national security team, with the replacement of US Secretary of State Rex Tillerson and National Security Adviser HR McMaster with Mike Pompeo and John Bolton respectively. These moves likely signal a more hawkish national security posture moving forward for the Trump administration and reportedly fueled concerns in Pyongyang that the US may be working towards a military strike of the North. By re-establishing high-level ties with Beijing, Kim has solidified relations with his country’s only real security guarantor.

But while the visit provides benefits going forward for Pyongyang, the big winner here is China. Amidst the flurry of diplomatic activity over the past month – Beijing was at risk of being sidelined as the Moon administration in South Korea appeared to be given a freehand at brokering summitry. China’s acceptance of Kim – despite the sustained imperfection in the Sino-North Korean relationship – has turned this formula upside down in some respects. Indeed, the bold move by China was largely precipitated by the fast-moving variables on the Korean Peninsula and Beijing’s dissatisfaction with potentially being largely an observer of the upcoming summits. The recent National People’s Congress meeting – marked by Xi’s further consolidation of power – provided the political space for this change of tact on North Korea and more pointed foreign policy.

The Xi-Kim summit also clearly signifies that China continues to be the most important player – outside of the US – in working towards a resolution of tensions on the Korean Peninsula. Beijing is often described as Pyongyang’s “lifeline” and has been resistant to turn its back on the Kim regime despite its frustrations with the rise in provocations and growth of its nuclear and missile programs. While characterisations of North Korea as a “client state” of China are unhelpful and don’t reflect the complexities of the relationship between Beijing and Pyongyang – there is no question that China (which represents 90 percent of North Korea’s trade) is an existential relationship for Kim. From Beijing’s view, this is more a marriage of geostrategic necessity rather than an alliance of shared values and goals for the region. Beijing’s prime goal will be to leverage its renewed influence on the Korean Peninsula to press for a quid pro quo: “resolution” to tensions for concessions that would weaken the US alliance system in the region, such as an eroded US-South Korea force posture and defanged trilateral cooperation between the US, South Korea and Japan.

This sets up a high-stakes game of summitry over the coming weeks which demands preparation and coordination between Seoul, Washington and also Tokyo. While it appears that North Korea is committed towards a meeting with the US, it is significantly less likely that it is interested in giving up its nuclear weapons programme without crippling concessions, such as the dismemberment of US-South Korea alliance and the removal of the US nuclear umbrella over the Korean Peninsula.

The views expressed in this article are the author’s own and do not necessarily reflect Al Jazeera’s editorial stance.