North Korean leader Kim Jong-un will travel to China at Xi Jinping's invitation, according to state media in both countries, with reports suggesting he could depart as soon as Monday - because nothing says "spontaneous diplomacy" like a train trip announced by two governments simultaneously.

Pyongyang's official Korean Central News Agency (KCNA) said Kim's trip to China will come "soon," a word that in diplomatic parlance means "we've told you it's happening, now stop asking for details." China's state news agency Xinhua confirmed only that a state visit by the leader would take place, offering no date or location within China - presumably because the itinerary is being kept in a locked drawer somewhere in Beijing.

Notably, this is the first time Beijing has described a visit by Kim as a state visit, the highest grade of diplomatic protocol. Previous trips were classified as either unofficial or official visits - a rung lower, like flying premium economy instead of first class. One assumes someone in Pyongyang is very pleased about the upgrade.

South Korea's Yonhap news agency, citing the country's spy agency, reported that the North Korean leader would leave by train for China on Monday and return home on Thursday. Kim was expected to pass through the border town of Dandong early on Tuesday before heading back to North Korea on Thursday. The train, one assumes, is nicer than the one you take to work.

Yonhap quoted intelligence committee officials as saying the two leaders would "coordinate messages toward the US ahead of the US-China G20 summit," which takes place in two weeks' time in Florida. Nothing says "casual state visit" like coordinating messages ahead of a summit.

"[Kim] wants to convey North Korea's position firmly to Trump through Xi Jinping, a powerful intermediary," said Nam Sung-wook, former head of South Korea's Institute for National Security Strategy. "China, for its part, can use North Korea as another point of leverage in dealing with Trump." In other words, Kim gets a messenger and Xi gets a bargaining chip - a rare win-win in the world of geopolitics.

Speaking on Sunday, South Korea's president, Lee Jae Myung, said a meeting between Kim and Xi would be "a good thing" for Seoul, while cautioning that there were too many variables to predict. Which is the diplomatic equivalent of saying "sounds great, but I'm not putting money on it."

Analysts in Seoul also expect the summit's outcome to feed into the Workers' Party plenary meeting late in December, at which North Korea is likely to set its policy towards Washington for the coming year. Because nothing says "Happy New Year" like a freshly calibrated policy toward the United States.

The visit comes after Donald Trump suggested he would be open to a meeting with Kim during his trip to China for the Asia-Pacific Economic Cooperation (Apec) this month. Trump has said a meeting was "up to" Xi, which is a bit like saying whether you'll attend a party is up to the host - technically true, but you've already picked out an outfit.

China is North Korea's largest trading partner and a vital source of diplomatic, economic and political support for Pyongyang, although ties have not always been smooth. The relationship, like many long-term partnerships, has its ups and downs - mostly ups for China, which holds most of the cards.

Speculation about a possible visit has circulated since Saturday, when South Korea's spy agency said it was monitoring "various developments" regarding Kim's movements. "Various developments" is spy-speak for "we know something's happening but we're not telling you what."

Kim previously made an unannounced, one-day visit to the Chinese border city of Dandong in October, crossing a major bridge linking China and nuclear-armed North Korea that is widely considered a symbol of their deepening economic ties. The bridge, one assumes, is the only thing getting a workout.

A visit to China could give Kim an opportunity to discuss with Xi the outcome of recent US-China talks and a trilateral summit involving Russia, another key ally of Pyongyang, experts say. Because what's a state visit without a thorough debrief of everyone else's meetings?

Kim has in recent months drawn closer to Russia, which maintains strategic, though imbalanced, relations with China. Pyongyang has sent North Korean soldiers to fight alongside the Russians against the Ukrainian army, while in return, Moscow has sent technological support to help with North Korea's weapons testing, experts say. It's the kind of quid pro quo that makes arms control advocates reach for the antacids.

China is seeking to curb this rapprochement and to strengthen its special relationship with North Korea. Xi chose North Korea as his first overseas visit this year in June, where he was greeted with opulent fanfare. Opulent fanfare, in this context, likely involved a lot of marching and very few casual conversations.

In contrast, Kim has repeatedly ignored overtures for talks from Trump, who has said a meeting was "up to" Xi. The US president suggested he was too busy to meet but that the two would "have that meeting at some point." "At some point" is doing a lot of heavy lifting in that sentence.

The visit comes during a wider drive by Pyongyang to develop an increasingly sophisticated arsenal of weapons despite international sanctions imposed over its banned nuclear and ballistic missile programmes. Because nothing says "diplomatic engagement" like a parallel weapons modernization program.

Kim visited a weapons systems school under the country's Missile Administration on Sunday, which he said played a crucial role strengthening North Korea's "overwhelming war response capability." The timing - just before a state visit to China - is presumably coincidental. Presumably.