SEOUL—President Trump became the first sitting U.S. president to step across the boundary dividing North and South Korea, leading to a hastily organized meeting with North Korean leader Kim Jong Un and a commitment to restart nuclear talks.

Mr. Trump said Sunday the two nations had agreed to designate nuclear negotiating teams that will begin work over the next several weeks. “We’re not looking for speed. We’re looking to get it right,” he said. “We’re on a very good path. This was a terrific day.”

While...