Whenever he speaks, North Korean leader Kim Jong-un can always expect his people to respond by clapping vigorously, sometimes with tears in their eyes. So it’s a bit hard to imagine that even he has to listen and take notes from another person.

That person turned out to be Chinese president Xi Jinping, whom Kim met in secret in Beijing from March 25 to 28. Chinese state news agency Xinhua confirmed their meeting (link in Chinese) only after Kim left Beijing this morning (March 28), although speculation had been rife over Kim’s whereabouts after a mysterious train from Pyongyang pulled into Beijing’s main train station on Monday night (March 26). It was Kim’s first trip abroad since he took power in 2011, and his first meeting with another head of state.

The Xi-Kim summit, convened at Xi’s invitation, came just days before a planned meeting between North and South Korea in preparation of a summit between the leaders of the two countries next month. Kim and US president Donald Trump are also mulling a meeting in May. According to an account published by Xinhua, Kim told Xi that he is open to dialogue with the South and the US, and is committed to the denuclearization of the Korean Peninsula.

“Currently, the situation on the Korean Peninsula is advancing rapidly and many important changes have taken place. From a friendly and moral perspective, I should also brief General Secretary Xi Jinping about the situation in person,” Kim was quoted as saying.

Footage broadcast on China’s state television CCTV showed Kim taking notes attentively as Xi spoke. The Chinese president did not take notes as Kim spoke. In addition, Kim was seen reading off prepared remarks, while there were no visible notes for Xi. A photo of Xi patting the back of Kim’s hand during their handshake also suggested it was the Chinese leader who dominated their meeting.

As North Korea’s only official ally, China has been put in an awkward position as the North’s weapons testing became increasingly frequent last year. For decades, China has relied on its belligerent neighbour as a buffer between itself and the US military presence in South Korea. But the Trump administration has been pressuring China to rein in the North, using US-China issues like trade as leverage. China, for its part, has been getting tougher on North Korea—for example, voting for the United Nations’ harshest-ever economic sanctions on the rogue regime in September—but not overly tough. In order to restart talks, China has suggested a “freeze for freeze” formula, namely that the US and the South suspend their decades-long joint military exercises, in exchange for the North stopping its missile and nuclear tests.

The meeting also marks a surprising change of tone in the China-North Korea relationship, which had been noticeably cold since Kim came to power. The two countries share a close friendship dating back to the Korean War, and previous North Korean leaders have all visited China. Xi’s predecessor, Hu Jintao, visited North Korea in 2005, becoming the last Chinese state leader to visit the country. (Xi himself, as vice-president, and other senior officials also visited the country in later years.)

Xi told Kim during their meeting that the Sino-North Korean friendship is a “precious asset” established by generations of leaders from the two sides, who exchanged views with each other as frequent as “visiting relatives.” He called for the establishment of more communication channels, for example sending special envoys to each other’s countries to “strengthen strategic communication.”

Several senior Chinese officials also attended the meeting, including premier Li Keqiang, vice president Wang Qishan, and Xi’s top policy advisor Wang Huning.

If anything, the Xi-Kim summit is a sign that Beijing and Pyongyang remain close allies based on shared security interests. In Mao Zedong’s characterization of the two countries’ relationship, “if the lips are gone, the teeth will be cold.” But based on their meeting, Xi wants Kim to know who’s on top in the relationship.