A visitor walks by the wire fence decorated with ribbons carrying messages to wish for the reunification of the two Koreas at the Imjingak Pavilion in Paju, South Korea, Tuesday, Jan. 9, 2018. (AP Photo/Lee Jin-man)

SEOUL, South Korea (AP) — The rival Koreas took steps toward reducing their bitter animosity during rare talks Tuesday, as North Korea agreed to send a delegation to next month's Winter Olympics in South Korea, hold talks on lowering tension along their border and reopen a military hotline.

The meeting, the first of its kind in about two years, was arranged after North Korean leader Kim Jong Un made an abrupt push for improved ties with South Korea following a year of elevated tensions with the outside world over his expanding nuclear and missile programs. Critics say Kim may be trying to divide Seoul and Washington in a bid to weaken international pressure and sanctions on the North.

"I think we took an important first step toward the development of South-North relations," chief South Korean delegate Cho Myoung-gyon said after the talks, according to media footage from the border village of Panmunjom, the venue.

Cho's North Korean counterpart, Ri Son Gwon, read a joint statement in which the two Koreas agreed to "actively cooperate" in the Pyeongchang Olympics to "enhance the prestige of the Korean people."

He said North Korea will send a delegation of officials, athletes, cheerleaders and journalists and South Korea will provide necessary services for the delegation.

"I believe that North Korea's participation in the Pyeongchang Games will provide us with a chance to reduce tension on the Korean Peninsula," said Cho, whose official title is unification minister.

During an earlier era of inter-Korean detente, athletes from the two Koreas paraded together at international sports events such as the Olympics and fielded a unified Korean team. The government of current South Korean President Moon Jae-in wants the two Koreas to agree to similar reconciliatory steps at the Feb. 9-25 Pyeongchang Games.

North Korea is weak in winter sports and a pair of figure skaters, Ryom Tae Ok and Kim Ju Sik, earlier became the only North Korean athletes to qualify for the Pyeongchang Games before the North missed a confirmation deadline. The International Olympic Committee said Monday it has "kept the door open" for North Korea to take part in the games.

North Korea also agreed to hold military talks with South Korea aimed at reducing animosity along their tense border and to restore a military hotline communication channel, according to Cho and Ri.

The restoration of the hotline was the second in about a week. All major inter-Korean communication channels had been shut down amid animosity over the North's nuclear program in recent years.

Cho said South Korea also called for talks at an early date on denuclearization of the Korean Peninsula to promote peace. He said the two Koreas would continue high-level talks but didn't say when the next meeting would take place.

South Korean officials earlier said they also suggested resuming temporary reunions of families separated by war. But the joint statement didn't mention such reunions.

South Korean Unification Minister Cho Myoung-gyon, right, shakes hands with the head of North Korean delegation Ri Son Gwon before their meeting at the Panmunjom in the Demilitarized Zone in Paju, South Korea, Tuesday, Jan. 9, 2018. (Korea Pool/Yonhap via AP)

The countries have a long history of failing to follow through with rapprochement accords. In 2015, negotiators met for nearly 40 hours before announcing a deal to pull back from a military standoff caused by land mine blasts that maimed two South Korean soldiers. But animosities flared again several months later after the North's fourth nuclear test.

The meeting's venue, Panmunjom, is the only place on the tense border where North and South Korean soldiers are just meters (feet) away from each other. A North Korean soldier in November defected to the South across Panmunjom amid a hail of bullets fired by his comrades. He was hit five times but survived.

An agreement on the North's Olympic participation had been widely expected before the talks began, but the Koreas appeared to remain sharply at odds over how to improve their overall ties.

North Korea was expected to demand rewards in return for South Korea's proposal of family reunions, such as a halt to South Korean propaganda broadcasts and a scaling back or halting of military drills with the U.S. It wasn't immediately clear whether the North made such a demand.

Suspension of the military drills would be unacceptable for Seoul because it would seriously undermine its alliance with its chief ally, the United States, which wants to put more pressure on North Korea. The North views the drills as a rehearsal for an invasion.

U.S. President Donald Trump on Saturday expressed hope for some progress from the talks and said he was open to talking with Kim himself. But U.N. Ambassador Nikki Haley later said the U.S. administration isn't changing its conditions regarding talks with North Korea, saying Kim first needs to stop weapons testing for a "significant amount of time."

In his New Year's Day address, Kim said he was willing to send a delegation to the Pyeongchang Games. He urged Seoul to halt the military drills with the U.S. and said he has a "nuclear button" to launch missiles at any target in the United States. Moon welcomed Kim's outreach and proposed the talks at Panmunjom.

Trump and Kim traded bellicose rhetoric and crude insults last year, as North Korea conducted it sixth and most powerful nuclear detonation and three tests of intercontinental ballistic missiles.