SEOUL, South Korea — The rival Koreas agreed Thursday to fully restore their cross-border communication lines after holding rare high-level military talks on reducing tensions.

The military officials also discussed temporarily disarming an area in their jointly controlled truce village of Panmunjom, where soldiers from the North and South stand several feet from each other across the demarcation line that divides their countries, South Korea's Defense Ministry said.

It wasn't immediately clear whether North Korean officials brought up the South's military drills with the United States during the talks at Panmunjom.

U.S. President Donald Trump said after his summit with North Korean leader Kim Jong Un on Tuesday that the allies should stop the war games while nuclear negotiations are being held in "good faith." South Korea's presidential office has said it's trying to discern Trump's meaning and intent, but also that the allies should explore various ways to "further facilitate" dialogue with the North.

Seoul's Defense Ministry said the military talks focused on implementing the agreements at an earlier summit between Kim and South Korean President Moon Jae-in, in which they vowed to reduce military tensions and eliminate the danger of war.

The discussions were the first general-level talks between the militaries since December 2007.

South Korea had pushed hard for the restoration of the military communication lines, which it says will be valuable in defusing crises.

North Korea in February 2016 shut down a line that had been used for military communication around the western coast of the peninsula to protest South Korea's decision to shut down a North Korean factory park that had been jointly operated by the countries. The South had been reacting to a North Korean nuclear test. The communication line was partially restored in January following the North's diplomatic outreach to the South ahead of February's South Korean Winter Olympics.

During Thursday's meeting, the military officials also agreed to restore a military communication line along the eastern coat that the North shut down in 2011.

The possible trust-building steps discussed between the military officials included disarming on a "trial basis" the Joint Security Area in the Panmunjom, which is the only spot in the Demilitarized Zone where the rivals' soldiers stand almost face to face. The area was where North Korean leader Kim stepped across the demarcation line to greet South Korean President Moon Jae-in for their historic summit in April. It was also where a defecting North Korean soldier fled south last year in a hail of bullets fired by his former comrades.

South Korean Maj. Gen. Kim Do-gyun told reporters before the talks that the southern delegation would "invest our best efforts to bring in a new era of peace on the Korean Peninsula."

At a building on the northern side of Panmunjom, the South Korean officials were greeted by a North Korean delegation led by Lt. Gen. An Ik San.

South Korean Maj. Gen. Kim Do-gyun told An that he was honored to meet him and expressed hope for a meaningful breakthrough in the talks.

Moon met Kim Jong Un in April and again in May as Pyongyang made a diplomatic push following a provocative run of nuclear and missile tests in 2017. The Koreas have agreed to various sets of peace talks, including planned discussions to set up reunions between war-separated families and to field combined teams at the Asian Games in Jakarta, Indonesia, in August.

The Korean Peninsula remains technically at war because the 1950-53 conflict ended in an armistice, not a peace treaty.

Annual military drills between Washington and Seoul have long been a major source of contention between the Koreas. North Korea, which sees the exercises as invasion rehearsals, last month broke off a high-level meeting with Seoul over South Korea's participation in a two-week military exercise with the United States.

A second summit between Kim and Moon in late May put the senior-level talks between the Koreas back on track. Still, North Korea's state media continued its criticism of allied military exercises, demanding Washington days later "stop the acts of threatening its dialogue partner by force."

Since the 1970s, the United States and South Korea have held a major summertime exercise called Ulchi Freedom Guardian that involves tens of thousands of troops.

Choi Hyunsoo, spokeswoman of South Korea's Defense Ministry, told reporters on Thursday that the allies "were closely coordinating and holding discussions" on the drills, which usually begin in August. She didn't elaborate on what was being discussed.

Critics say the allies would be sending a bad signal to North Korea if they stop the drills before the North takes concrete steps toward denuclearization. There are lingering doubts on whether Kim would ever agree to fully relinquish the weapons he may see as his strongest guarantee of survival.