Updated

The mysterious meeting Kim Jong Un was summoned to in Beijing this week likely saw China's president remind the North Korean dictator who his real patron is ahead of talks with the U.S., according to experts.

Kim and his wife, Ri Sol Ju, made a surprise visit to Beijing on Monday, arriving on a mysterious green train that sparked rumors the North Korean first family was in China. The trip was planned in the weeks after President Trump announced he had accepted the despot’s invitation to meet by May, Yun Sun, who runs the East Asia program and the China Program at the Stimson Center, told Fox News.

e63db4d1-NORTHKOREA-MISSILES/CHINA

Kim Jong Un met with Xi Jinping in a surprised visit earlier this week. (KCNA via Reuters)

“We know that China has rejected a request for a visit by North Korea in the last six years,” Yun Sun told Fox News on Wednesday. “It has not happened up until this point. What has changed is that this trip happened relatively quickly, after Kim reached out to Trump.”

Sun said that, after the stunning announcement of a U.S.-North Korea summit, China likely demanded an explanation about why it was left out of the talks, developing anxiety the U.S. and North Korea were engaging in secrete dialogue. She said the March 9 announcement was a major “catalyst” for China inviting North Korea to Beijing.

“If you look at the tactical level, the Chinese did not want to invite Kim to Beijing," Sun said. "Based on that technical aspect, North Korea was successful in getting an upper hand over China.”

2cdcabd4-NORTHKOREA-MISSILES/CHINA

Kim Jong Un and Xi Jinping during its visit that began Sunday with Kim traveling to Beijing. (Reuters)

Sun, however, said China still has the strategic upper hand. North Korea remains dependent on China and could not refuse the meeting. The train ride to Beijing was also the despot’s first foreign trip since taking power in 2011.

“Most importantly, Beijing is concerned with any concessions that North Korea might make toward the U.S. in exchange for a U.S. security guarantee, or a settlement that could lead to the unification of the Korean Peninsula by absorption and the emergence of a unified Korea as an American military ally on China’s border,” Sun wrote in an analysis on 38 North.

NORTHKOREA-MISSILES/CHINA

Kim Jong Un, his wife Ri Sol Ju, with Xi Jinping and his wife Peng Liuyan. (KCNA via Reuters)

Ties between China and North Korea have frayed in recent months as China supported tougher U.N. sanctions against North Korea and suspended coal and iron ore imports. Pyongyang last year seemingly sought to humiliate Beijing by timing some of its missile tests for major global summits in China.

"Kim Jong Un's visit shows that China is not marginalized, but playing a leading role. This saves China a lot of face," Pang Zhongying, a North Korea expert at Renmin University in Beijing, told The Associated Press. "[Meanwhile] North Korea once again is taking advantage of China. It plays the China card, showing South Korea and the U.S.: China is still my ally."

Photos released Wednesday showed a cordial meeting between Kim, Xi and their spouses. Kim was pictured clinking glasses with Xi, dining and walking through a guesthouse complex in China’s capital.

During the meeting, which was officially announced Wednesday, Kim said North Korea is “committed to denuclearization,” according to China’s Foreign Ministry.

kim jong un china

Xi Jinping and Kim Jong Un meet for the first time since the despot took power in 2011. (KCNA via KNS)

“It is our consistent stand to be committed to denuclearization on the peninsula, in accordance with the will of late President Kim Il Sung and late General Secretary Kim Jong Il,” Kim said, according to Reuters.

The Associated Press contributed to this report.