SEOUL, South Korea — The leaders of North and South Korea agreed on Friday to work to remove all nuclear weapons from the Korean Peninsula and, within the year, pursue talks with the United States to declare an official end to the Korean War, which ravaged the peninsula from 1950 to 1953.
At a historic summit meeting, the first time a North Korean leader had ever set foot in the South, the leaders vowed to negotiate a treaty to replace a truce that has kept an uneasy peace on the divided Korean Peninsula for more than six decades. A peace treaty has been one of the incentives North Korea has demanded in return for dismantling its nuclear program.
“South and North Korea confirmed the common goal of realizing, through complete denuclearization, a nuclear-free Korean Peninsula,” read a statement signed by North Korea’s leader, Kim Jong-un, and the South’s president, Moon Jae-in, after their meeting at the border village of Panmunjom.
The agreements came at the end of a day of extraordinary diplomatic stagecraft emphasizing hopes for reconciliation and disarmament that was broadcast live around the world, beginning with a smile and handshake that Mr. Kim and Mr. Moon shared at the border and extending to a quiet, 30-minute talk they had near the end of the day in a wooded area of the village.
Their meeting was marked by some surprisingly candid moments but also sweeping pledges, with Mr. Kim declaring, “I came here to put an end to the history of confrontation.” Still, the agreement was short on details, timetables and next steps.
The event, at the Peace House, a conference building on the South Korean side of Panmunjom, was closely watched because it could set the tone for the even more critical summit meeting between President Trump and Mr. Kim, two leaders known for bold, if unpredictable, actions who put the world on edge last year with threats of a nuclear war.
The Trump administration has tightened sanctions on North Korea with China’s help and, mindful that the North has failed to deliver on its promises in the past, insisted that Mr. Kim make substantial progress dismantling his nuclear arsenal before the “maximum pressure” campaign is eased.
But by agreeing to pursue a peace deal this year, Mr. Moon held out the prospect of progress toward one of North Korea’s top goals before the North has given up its nuclear weapons, and perhaps measures to withdraw troops from inside the Demilitarized Zone, the heavily armed buffer area between the two Koreas, and create a joint fishing zone around the disputed western sea border, a scene of bloody naval skirmishes between the two Koreas.
Mr. Moon also dangled an economic incentive, reaffirming promises made in the past by the South of huge investments to help improve the North’s road and train systems. But those agreements collapsed as the North persisted in developing nuclear weapons, and Mr. Moon’s aides have said that such assistance can only come after the North makes progress toward denuclearization and sanctions are lifted.
In Washington, Mr. Trump signaled his support of Mr. Moon’s position, writing early Friday on Twitter: “Good things are happening, but only time will tell!” Fifteen minutes later, he declared in an all-caps tweet, “KOREAN WAR TO END!” and said that all Americans should be “very proud” of what was taking place on the Korean Peninsula.
During an appearance in the Oval Office with Chancellor Angela Merkel of Germany on Friday, Mr. Trump said he believed that the North Korean leader was serious about making a deal to give up his nuclear weapons.
“I don’t think he’s playing,” said Mr. Trump, who faulted his predecessors for their handling of the threat from North Korea, saying they had allowed themselves to be duped.
“The United States has been played beautifully, like a fiddle, because you had a different kind of a leader,” Mr. Trump said. “We’re not going to be played, O.K.? We’re going to hopefully make a deal; if we don’t, that’s fine.”
On Twitter, Mr. Trump also thanked President Xi Jinping of China for his “great help” in the process.
China’s state news media played the summit meeting prominently, even though China had been left on the sidelines with little influence over the proceedings. The Chinese Foreign Ministry praised the courage of the two Korean leaders, and said it welcomed “the new journey” for peace on the Korean Peninsula.
The tone of the summit meeting — much of which was broadcast live in South Korea but not North Korea — was convivial and at times jocular, with Mr. Kim showing surprising honesty about the differences in conditions between the two nations.
Yoon Young-chan, Mr. Moon’s spokesman, said Mr. Kim acknowledged the poor road conditions in his country, a startling admission for a member of his ruling family, which is considered godlike and faultless among North Koreans. Mr. Kim also revealed that the North Koreans who visited the South during the Winter Olympics in February all admired the bullet train there.
After Mr. Moon spoke of wanting to visit North Korea, Mr. Kim said, “It will be very embarrassing,” alluding to roads there.
Mr. Kim also repeated a lighthearted line he had used in his meeting with South Korean envoys who visited Pyongyang, the North Korean capital, last month, apologizing to Mr. Moon for disturbing his sleep with missile tests and forcing him to attend meetings of his National Security Council.
“I heard you had your early-morning sleep disturbed many times because you had to attend the N.S.C. meetings because of us,” Mr. Kim said. “Getting up early in the morning must have become a habit for you. I will make sure that your morning sleep won’t be disturbed.”
Mr. Moon joked back: “Now I can sleep in peace.”
An armistice brought about a cease-fire to the Korean War in 1953, but the conflict never officially ended because the parties could not agree to a formal peace treaty. They would have to overcome significant obstacles to do so now, including China’s likely demand that American troops leave South Korea.
In their joint statement, the two Korean leaders said that within a year, they would push for a trilateral conference with the United States, or a four-party forum that also included China, with the aim of “declaring an end to the Korean War” and intentions to “replace the armistice with a peace treaty.”
Mr. Kim and Mr. Moon also agreed to improve inter-Korean relations by opening a liaison office in the North Korean border town of Kaesong and arranging a reunion later this year of families separated by the war. And they said Mr. Moon would visit Pyongyang in the fall.
Mr. Moon, a progressive leader who says he likes to see South Korea “in the driver’s seat” in pushing the peace effort forward, is trying to broker a successful summit meeting between Mr. Kim and Mr. Trump, which is expected in late May or early June.
Mr. Kim rattled the region last year by testing long-range missiles and trading threats of nuclear war with Mr. Trump. But then he abruptly shifted gears, saying he was willing to give up his nuclear weapons for the right incentives and proposing the meeting with Mr. Trump.
Last weekend, Mr. Kim announced an end to all nuclear and long-range-missile tests, saying that his country had mastered how to mount nuclear warheads on missiles and no longer needed to conduct tests. Mr. Kim said North Korea had adopted a “new strategic line” focusing on economic development.
Skeptics say Mr. Kim is trying to improve ties with South Korea to steer it from the United States and escape sanctions that are increasingly hurting the North’s economy. Indeed, many conservatives in the South fear that the North’s goal remains to be accepted as a nuclear power in return for freezing its nuclear and intercontinental ballistic missile programs.
The declaration by Mr. Kim and Mr. Moon “is breathtaking in its scope and ambition,” David Albright, president of the Washington-based Institute for Science and International Security, said by email. “But how to achieve all the goals laid out in the document, given the current situation?”
Unless “a firm foundation” for North Korea’s verifiable nuclear disarmament were laid out, he added, most of the other commitments in the agreement were “merely wishes.”
Analysts have warned that once negotiations begin with the United States, North Korea could push them into a stalemate by trying to drag Washington into nuclear arms reduction talks.
To prevent that, South Korea and the United States are trying to persuade North Korea to agree to a specific timeline for complete denuclearization: as soon as possible and no later than the end of Mr. Trump’s current term, in early 2021, according to South Korean officials and analysts.
During their morning talks, Mr. Kim pushed for more summit meetings with Mr. Moon, saying he would like to visit the presidential Blue House in Seoul. He said North Korea would cooperate to make a “better world.”
But he also voiced caution, suggesting South Korea and the United States deserved blame for scuttling previous deals.
“As the expectations are high, so is the skepticism,” he said. “In the past, we had reached big agreements, but they were not implemented for more than 10 years. There are people who are skeptical that the results of today’s meeting will be properly implemented.”