Beijing (CNN) North Korea's leader Kim Jong Un is believed to have wrapped up an unprecedented whirlwind trip to the Chinese capital, ahead of a planned summit with his South Korean counterpart and a potential meeting with US President Donald Trump.

An official with deep knowledge of North Korea told CNN Tuesday there was a "strong possibility" that Kim was in Beijing after speculation began swirling late Monday about the arrival of a high-level North Korean official.

The rumors started after images were shared online of what appeared to be a train that belongs to North Korea's ruling Kim family arriving in Beijing, and intensified as security officials closed roads outside the Diaoyutai State Guesthouse, where North Korean leaders have previously stayed.

A police and two paramilitary police officers take position near Tiananmen Square on Tuesday.

Analysts said the visit was likely aimed at shoring up Pyongyang's relationship with China, its traditional ally and economic benefactor, after a diplomatic thaw that took many observers by surprise earlier this year.

If Kim did make the journey from Pyongyang to the Chinese capital, it would be the first time the young leader has left his home country since taking power after his father's death in 2011.

Read More