In telling the North it should return to the negotiating table, Mr. Xi appeared to strike a stern tone, saying, “The Chinese position is very clear: no matter how the situation changes, relevant parties should all adhere to the goal of denuclearization of the peninsula, persist in safeguarding its peace and stability, and stick to solving problems through dialogue and consultation.”

The Chinese leader called for resuming the so-called six-party talks, the diplomatic effort among six countries including China and the United States that collapsed in 2008 when North Korea walked out.

American experts on North Korea say it is unlikely that North Korea would agree to the talks, largely because the United States and South Korea would insist on preconditions like a pledge from North Korea that it would abandon its nuclear program.

The warning Friday from Mr. Xi follows a clear message the Chinese president delivered at a conference in April at Boao in southern China, when he said that “no one should be allowed to throw a region and even the whole world into chaos for selfish gain.”

The official China News Service said Choe delivered the handwritten letter from Kim to Xi at an afternoon meeting at the Great Hall of the People in central Beijing. It gave no details about the letter’s contents.

North Korea is willing to work with all sides to “appropriately resolve the relevant questions through the six-party talks and other forms,” Choe was quoted as saying by Chinese state broadcaster CCTV. He said Pyongyang was “willing to take active measures in this regard.”

Choe offered no details on how North Korea planned to resume talks. North Korea walked away from the six-party nuclear disarmament talks in 2009 over disagreements on how to verify steps the North was meant to take to end its nuclear programs. Foreign observers often claim that North Korea has a history of raising tensions in an attempt to push its adversaries to negotiations meant to win aid.

Since its third nuclear test, in February, North Korea has repeatedly said that any future diplomatic talks would have to recognize it as a nuclear power. That’s at odds with the basis of the six-party talks and puts Pyongyang at loggerheads with Washington, which says it won’t accept North Korea as an atomic power and demands that talks be based on past commitments by the North to abandon its nuclear programs.