Chinese President Xi Jinping has coached his North Korean counterpart Kim Jong Un on high-stakes diplomacy. Now he seems poised to give the young autocrat another lesson: how to reform a state-controlled economy while keeping an iron grip on power.
Beijing has long pushed for Pyongyang to adopt similar measures to those that fuelled China's dizzying ascent from a communist backwater to one of the world's largest trading powers.
But while the highly secretive, nuclear-armed North has been quietly carrying out economic reforms for some time, officially it still promotes the merits of its system and denounces the evils of capitalism.
In recent months, as relations between China and North Korea have experienced a renaissance, Kim has transformed from a recalcitrant and standoffish troublemaker to Xi's eager pupil.
North Korea`s leader Kim Jong-un and his Chinese counterpart Xi Jinping
The shift followed a decision by Beijing to back UN sanctions banning imports of coal, iron ore and seafood from its unruly neighbour, after years of hushed diplomacy failed to convince the North to stop its nuclear and missile tests.
It didn't take long for Kim to change his tune: he made his first visit as leader to his country's sole major ally in March, quickly followed by two more trips, during which he toured Chinese tech and science hubs.
Kim, who is in his mid-30s, seemed eager to learn: Chinese state media has been filled with images of the attentive leader taking copious notes during his meetings with Xi.
"We are happy to see that the DPRK (North Korea) made a major decision to shift the focus to economic construction," Xi told Kim in their most recent meeting Tuesday, according to state news agency Xinhua.
"China is ready to share its experience" with Pyongyang, Xi said the next day.
- China as a model -
China's "reform and opening" under Deng Xiaoping in the 1980s started an economic boom that has made it the world's second-largest economy and a crucial driver of global growth.
Despite pressure from Beijing to follow its example, in public Kim had appeared resistant, in 2016 decrying "the filthy wind of bourgeois liberty and 'reform' and 'openness' blowing in our neighbourhood".
But in practice he has brought in limited changes, from allowing private traders to operate in informal markets to giving state-owned enterprises some freedoms to operate, and turning a blind eye to private company operations.
Having completed the development of his atomic arsenal, Kim announced in April that his priority was now "socialist economic construction".
A delegation from his ruling Workers' Party of Korea visited Beijing in May to learn about economic reforms.
At a historic summit with US President Donald Trump in Singapore last week, Kim expressed his commitment to the denuclearisation of the Korean peninsula -- and Washington is offering him sanctions relief if he gives up his weapons.
The summit also saw Kim take the opportunity to explore the affluent city-state, with images of his visit to an expensive hotel, casino and other tourist sites widely distributed by North Korean media.
The visit bore "a certain historic resemblance" to a 1979 trip by China's then-leader Deng to the United States as the country stood on the verge of economic reform, said Zhao Tong, North Korea specialist at the Carnegie-Tsinghua Center in Beijing.
Deng was able "to see for himself the successful development of western countries", said Zhao, who predicts that North Korea has now reached its own major turning point.
- Afraid of collapse -
Before leaving Beijing on his latest visit this week, Kim toured an agricultural technology park and a rail traffic control centre.
"It looks like this trip is aimed at studying China as a model for economic development post-denuclearisation," said Koh Yu-hwan, professor of North Korean Studies at Dongguk University, pointing to the attendance of Pyongyang's chief economic officer Premier Pak Pong Ju.
The collapse of the Soviet Union in the early 1990s has so far deterred North Korea from opening up its economy as much as China would like.
But Beijing has spelled out to North Korea that it believes its economic success was achieved thanks to the help of a stable Communist regime.
"China has been saying to North Korea for years that it's possible to maintain a one-party regime while opening up to the outside world," said China expert Jean-Pierre Cabestan of Hong Kong Baptist University.
Xi's tightening grip on power since coming to power in late 2012 -- with a lack of organised opposition and the use of surveillance technology to keep tabs on the population -- will likely help reassure Kim, Cabestan said.
Despite its fear of failure, "at the moment there is no other option" for North Korea other to open up, said Zhu Feng, international relations professor at China's Nanjing University.
However a prosperous South Korea complicates the situation for the North, which may fear being swallowed up by Seoul economically if they reunify, as happened to the former East Germany, Cabestan said.
For the time being, Pyongyang's official line remains the same.
Capitalism "is a corrupt society rushing headlong into its doom", the state-run Rodong Sinmun newspaper wrote last week.