SEOUL, South Korea — North Korea’s leader, Kim Jong-un, arrived in Beijing on Tuesday for a four-day visit at the invitation of President Xi Jinping, Chinese and North Korean official media said.

The visit offers Mr. Kim and Mr. Xi an opportunity to coordinate strategy face to face should Mr. Kim have a second summit meeting with President Trump.

Xinhua, the official Chinese news agency, confirmed Mr. Kim’s visit after a flurry of reports from South Korean media that a train appearing to be carrying a senior North Korean official had passed through Dandong, a Chinese city on the border with North Korea. The train entered China on Monday and pulled into Beijing on Tuesday morning, the South Korean news agency Yonhap reported.

North Korea’s state-run Central Television also confirmed the visit, reporting that Mr. Kim started the four-day visit to the country on Monday at Mr. Xi’s invitation. It said he was accompanied by his wife, Ri Sol-ju, and senior officials, including Kim Yong-chol, Mr. Kim’s right-hand man in diplomatic negotiations with the United States and South Korea.