Image caption Preliminary talks took place in the truce village of Panmunjom on Sunday

Officials from North and South Korea have agreed to hold their first high-level meeting since 2007.

The agreement came after hours of preliminary talks in the truce village of Panmunjom aimed at rebuilding trust between the two sides.

The talks will take place in Seoul on Wednesday and Thursday.

The announcement follows months of tension between the two nations, following the North's third nuclear test in February.

'Separate statements'

The talks in Panmunjom - where the armistice agreement ending fighting in the 1950-53 Korean War was signed - continued into the night.

Analysis There is a sense of cautious optimism in Seoul now that the two Koreas are talking again. Hope has been rekindled that the Kaesong industrial complex could reopen after the North pulled its 53,000 workers out in protest over military exercises in the South. However, the outcome of the talks this week is hard to predict. It took a long time to set up the meeting and Seoul doesn't want to talk for the sake of talking. It wants to end the vicious circle of seeing the North raise military tensions and then engage in renewed dialogue only to face further brinkmanship - a pattern that has been going on for the past two decades. The South is looking for assurances before operations in Kaesong can reopen, so that in the future it would be harder for the North to close the plant for political reasons.

The deal to hold higher level talks came in the early hours of Monday, but the two sides have not yet agreed on the other detailed agenda items.

"Both sides issued separate statements on the outcome of discussions after failing to narrow differences over the level of chief delegate and agenda," South Korea's Unification Ministry said.

Unification Minister Ryoo Kihl-jae will lead South Korea's delegation to the meeting later this week and has asked the North to send the head of the United Front Department of the ruling Workers' Party, Kim Yang-gon.

However, it is not yet clear who the North will send to the meeting.

An unnamed official from South Korea's Ministry of Unification would not confirm reports that denuclearisation would be discussed at the meeting, but said that "all matters that can enhance peace and stability can be discussed at the two-day talks", South Korean news agency Yonhap reported.

North Korea's Central News Agency said the main point of discussion would be restoring suspended commercial links, particularly the Kaesong joint commercial zone which was shut down by the North in April as tensions escalated.

Other issues up for discussion are the reunion of separated families and their relatives and the resumption of tours to North Korea's Mount Kumgang.

South Korean tours to the North Korean resort ended after a South Korean tourist was shot and killed by a North Korean guard in 2008.

Revenue stream

Ties between the two Koreas deteriorated earlier this year in the wake of the North's nuclear test on 12 February.

Timeline: Korean tensions 12 Dec: North launches a rocket, claiming to have put a satellite into orbit

North launches a rocket, claiming to have put a satellite into orbit 12 Feb: North conducts underground nuclear test

North conducts underground nuclear test 11 Mar : US-South Korea annual military drills begin

: US-South Korea annual military drills begin 30 Mar: North says it is entering a "state of war" with South

North says it is entering a "state of war" with South 2 Apr: North says it is restarting Yongbyon reactor

North says it is restarting Yongbyon reactor 3 Apr: North blocks South workers from Kaesong industrial zone, then on 9 Apr pulls its workers out

North blocks South workers from Kaesong industrial zone, then on 9 Apr pulls its workers out 10 Apr: North moves two mid-range Musudan missiles to its east coast

North moves two mid-range Musudan missiles to its east coast 26 Apr : Seoul announces withdrawal of all remaining South Korean workers from Kaesong

: Seoul announces withdrawal of all remaining South Korean workers from Kaesong 2 May: North Korea jails US man for 15 years

North Korea jails US man for 15 years 22 May: North Korea sends envoy to China

North Korea sends envoy to China 6 June: North and South Korea agree to talks on Kaesong Industrial Complex Q&A: Kaesong Industrial Complex Picking apart the bluster

Pyongyang withdrew its workers from the Kaesong in April, apparently angered by tightened UN sanctions after the nuclear test and annual South Korea-US military drills.

The Kaesong commercial zone, seen as a symbol of North-South co-operation, had run successfully for more than eight years.

The zone was a key source of revenue for the North and the biggest contributor to inter-Korean trade.

Around 53,000 North Korean workers were employed at the Kaesong factory complex by more than 120 South Korean factories.

Last Thursday, the North offered talks with the South on the resumption of operations and said it would reconnect a Red Cross hotline if Seoul - which had been seeking such talks - agreed.

The new South Korean leader, President Park Geun-hye, has said she wants to build trust after a period of very chilly ties under the previous administration in Seoul.

The inter-Korean talks in Panmunjom closely follow a summit in California between US President Barack Obama and Chinese President Xi Jinping.

Both leaders agreed that North Korea had to denuclearise and that neither country would accept North Korea as a nuclear-armed state, US National Security Advisor Tom Donilon said on Saturday.

China is seen as a key ally of Pyongyang and the only nation capable of brining meaningful pressure to bear on the communist state.

Japan's Chief Cabinet Secretary Yoshihide Suga welcomed the announcement of talks between the two Koreas. "As for Japan, we will maintain close co-operation with South Korea, the United States and other related countries in dealing with the issue," he said.