BUSAN, South Korea—The two Koreas held their highest-level talks in years Saturday as a surprise visit by top North Korean officials to South Korea for a sporting event allowed the governments to break a diplomatic deadlock.

The North Korean delegation, led by Hwang Pyong So, considered by many outside observers to be No. 2 in the isolated nation’s hierarchy, met with South Korean Unification Minister Ryoo Kil-jae, National Security Office head Kim Kwan-jin and other senior officials for lunch.

Details of the conversation weren't disclosed. But ahead of the meeting, top North Korean sports official Choe Ryong Hae said support from South Korea had been a “big help” for North Korean athletes during the Asian Games, which ended on Saturday.

“I take pride that sports seems to be at the forefront of affairs leading to (potential) unification,” Mr. Choe was shown saying on South Korean television. The officials were to attend the closing ceremony for the Asian Games Saturday evening in Incheon, west of Seoul, before flying home the same day.

South Korea’s Unification Ministry said in a statement the two sides agreed to hold further high-level talks between late October and early November. The North Korean group expressed a willingness to continue conversation with South Korea, the ministry said.