Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

North Korean leader Kim Jong Un traveled to Beijing for talks with Chinese President Xi Jinping, state-run media in both countries reported early Wednesday.

It is believed to be Kim's first foreign trip since he took power in 2011.

There had been speculation that Kim was spotted aboard a train in China's capital on Tuesday.

China's Xinhua news agency did not answer that question, but reported Wednesday that the North Korean dictator had met with Xi.

South Korea's Yonhap news agency also reported that Kim visited China from Sunday to Wednesday along with his wife, Ri Sol Ju. It cited North Korean state-run radio.

Xinhua called it an unofficial visit, adding that Xi held talks with Kim at the Great Hall of the People in Beijing.

China is North Korea’s neighbor and most important ally.

In a statement Tuesday night, White House press secretary Sarah Huckabee Sanders said: "The Chinese government contacted the White House earlier on Tuesday to brief us on Kim Jong Un's visit to Beijing. The briefing included a personal message from President Xi to President Trump."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

She added: "The United States remains in close contact with our allies South Korea and Japan. We see this development as further evidence that our campaign of maximum pressure is creating the appropriate atmosphere for dialogue with North Korea."

President Donald Trump and Kim have traded barbs for months over North Korean missile tests and its nuclear program.

Kim has repeatedly vowed to destroy South Korea along with the U.S., while Trump has threatened Pyongyang with "fire and fury."

North Korea tested a total of 23 missiles last year, including 15 that were nuclear-capable. The November launch of which appeared to be an intercontinental ballistic missile, or ICBM, flew farther than any of Kim's previous tests. The North claimed it could reach anywhere in the mainland U.S.

Analysts say that based on the current evidence it's hard to prove or debunk North Korea's claim that it can now hit faraway American targets such as New York or Washington.

North Korea has said in public statements that it wants an official end to the Korean War. The conflict was halted by a 1953 armistice but no peace treaty has been signed. It also wants nothing short of full normalization of relations with the U.S. and to be treated with respect and as an equal in the global arena.

The Trump administration has encouraged China to use its influence to rein in Pyongyang. In September, China ordered North Korean-owned businesses to close and imposed limits on oil to North Korea.

The Beijing visit also comes ahead of a planned meeting with Trump.

For years and through many administrations, everyone said that peace and the denuclearization of the Korean Peninsula was not even a small possibility. Now there is a good chance that Kim Jong Un will do what is right for his people and for humanity. Look forward to our meeting! — Donald J. Trump (@realDonaldTrump) March 28, 2018

Received message last night from XI JINPING of China that his meeting with KIM JONG UN went very well and that KIM looks forward to his meeting with me. In the meantime, and unfortunately, maximum sanctions and pressure must be maintained at all cost! — Donald J. Trump (@realDonaldTrump) March 28, 2018

The United Nations also imposed tough new sanctions on North Korea last year. On Tuesday, State Department spokeswoman Heather Nauert said Russia and China can "do more" on North Korea.

Former deputy and acting CIA director John McLaughlin said on MSNBC earlier Tuesday that the reported visit highlights China’s nervousness about talks between South and North Korea, and not wanting to be left on the sidelines.