A visitor poses for souvenir photos in front of a wire fence covered with ribbons carrying messages left by visitors wishing for the reunification of the two Koreas, at the Imjingak Pavilion near the border village of Panmunjom, which has separated the two Koreas since the Korean War, in Paju, north of Seoul, South Korea, Sunday, June 9, 2013. (Lee Jin-man/AP)

North and South Korea held a 17-hour meeting lasting from Sunday into Monday, and they agreed to reconvene this week for what would be their highest-level talks in six years.

The dialogue Sunday, at a powder-blue hut in the middle of the demilitarized zone between the Koreas, seemed to provide evidence that Seoul and Pyongyang want to back away from the hostility of recent months — a period during which the neighbors cut nearly all ties.

But the meeting — which involved lower-level officials — wasn’t without differences, as the two sides tried to set the stage for senior-level talks. They haggled over the agenda and attendees.

Those talks are scheduled for Wednesday and Thursday in Seoul. But it remains unclear who will represent the two governments, and a North Korean statement said only that the talks would be held “between authorities.” South Korea said it would hold a media briefing Monday morning.

South Korea had hoped for a summit of cabinet ministers, but that has “not been agreed upon as of yet,” a spokesman for the South’s Ministry of Unification said.

Understanding between the Koreas has proved elusive in recent years, a period during which the North has tested underground nuclear devices, fired long-range rockets and carried out a pair of fatal attacks on the South. The last time Seoul and Pyongyang met on the peninsula for formal talks, in February 2011, North Korea’s representatives abruptly refused to continue, and the North said its counterparts were “scoundrels” and “traitors” who had no interest in reconciliation. Those talks, too, had been designed to pave the way for a higher-level meeting.

On Sunday, South Korea’s three-person delegation was represented by Chun Hae-sung, who told reporters before the talks that he wanted to “build trust” in North-South relations. That goal ­corresponds with the yet-unrealized “Trustpoli­tik” strategy of South Korean President Park Geun-hye, who wants to restart small cooperative projects with the North and add more ambitious ones if things go well.

This week, the two sides are likely to discuss resuming operations at Kaesong, a jointly run industrial complex that shut down in April when the North pulled out its 53,000 workers. Pyongyang also is pushing the South to resume tours at the North Korean resort of Mount Kumgang, where in 2008 a South Korean tourist was shot and killed by a North Korean guard.

A relative breakthrough came last week when North Korea, after months of warlike threats, proposed government talks. But analysts in Seoul are doubtful that the North, under third-generation leader Kim Jong Un, is willing to change its broader pattern of behavior — raising tensions, then trying to win concessions on issues such as aid and energy through reconciliation.

The North has vowed repeatedly to never give up its stockpile of nuclear weapons. This week’s talks won’t deal directly with denuclearization, but the North’s stance represents a barrier to multinational talks, where the implicit goal is to change North Korea’s menacing tactics. South Korea says it isn’t interested in joining the so-called six-party talks — which also involve the United States and China — unless the North shows genuine interest in giving up its nuclear weapons.