A special train believed to be carrying Kim Jong Un departed Beijing Wednesday after a two-day visit by the North Korean leader to the Chinese capital. Kim couldn't be seen, but was presumed to be on board the long train as it crossed on elevated tracks over a busy Beijing street and headed toward eastern China and the border with North Korea.

He was expected to arrive back home Thursday morning, the South Korean news agency Yonhap reported.

Kim's trip to China - his fourth in the past 10 months - was believed to be an effort to coordinate with his only major ally ahead of a possible second summit with President Trump. It came after U.S. and North Korean officials were thought to have met in Vietnam to discuss the site of the summit.

Get Breaking News Delivered to Your Inbox

Details of his visit weren't released, but Yonhap said Kim met with Chinese President Xi Jinping.

Among those in Kim's entourage were Kim Yong-chol, a key nuclear negotiator with the U.S., and North Korea's foreign and defense ministers, Yonhap noted.

Still image taken from Reuters TV footage shows train believed carrying North Korean leader Kim Jong Un leaving Beijing Railway Station on January 9, 2019 REUTERS TV / REUTERS

Earlier Wednesday, Kim's motorcade headed out to an unannounced destination and returned about an hour later.

Yonhap said Kim visited a technology development zone and spent around 20-30 minutes touring a factory run by famed traditional Chinese medicine maker Tong Ren Tang.

North Korean and Chinese state media announced his visit shortly in advance of his arrival in Beijing, in a break with standard protocol dictating such trips are only confirmed after they happen. However, neither side has provided details of what he did since arriving aboard his personal armored train Tuesday morning.

Yonhap said Kim met with Xi for about an hour Tuesday and later attended a dinner at the Great Hall of the People in central Beijing hosted by Xi and his wife, Peng Liyuan. Kim was accompanied by his wife, Ri Sol Ju, the news agency said.

At Tuesday's daily Foreign Ministry briefing, spokesman Lu Kang said details of Kim's visit would be released "in due course." He said Beijing remains supportive of efforts to end tensions over U.S. demands for a halt to North Korea's nuclear and missile programs.

"We always believe that, as key parties to the Korean Peninsula issue, it's important for the two sides to maintain contact and we always support their dialogue to achieve positive outcomes," Lu said.

North Korean leader Kim Jong Un waves from his train before it departs from Pyongyang to make the trip to Beijing, China, Jan. 7, 2019. Reuters/Handout

Tuesday was Kim's birthday. His visit was also seen as part of an effort to win Chinese support for a reduction of U.N. sanctions imposed over his nuclear weapons and ballistic missile programs, which have severely impacted his country's already ailing economy.

While Pyongyang hasn't conducted any launches or detonations in more than a year, it's displayed no real intention of abandoning the programs, which are seen as guaranteeing the hardline communist regime's survival.

Kim's visit also came after he expressed frustration in his annual New Year's address over the lack of progress in negotiations with Washington since the Singapore summit with Trump in June, saying that if things don't improve - meaning that if sanctions relief and security guarantees aren't in the offing - the North might have to find "a new way" forward.

While Mr. Trump says he considers Xi key to enticing Kim into taking concrete steps toward denuclearization, the president's own relationship with his Chinese counterpart has frayed over the U.S.-China trade war.

Officially, at least, China says it considers the tariff battle and North Korea's weapons programs to be entirely separate.