(Bloomberg) -- The leaders of South Korea and Japan had a brief chat on the sidelines of a meeting in Madrid, a rare conversation between neighbors often at loggerheads over their shared history who have not had a formal summit since 2019.

Japanese Prime Minister Fumio Kishida and new South Korean President Yoon Suk Yeol spoke for a few minutes at a dinner hosted Tuesday by King Felipe of Spain, their governments said. The two Asian leaders are attending a NATO summit in the city and plan to have a meeting jointly with US President Joe Biden on Wednesday to discuss security threats including North Korea’s nuclear arms program.

Kishida told Yoon that he hopes the South Korean leader would work to restore “extremely severe” relations, Japan’s Foreign Ministry said. Yoon wished Kishida good luck in an upcoming parliamentary election, adding he was ready to set off on a more “future-oriented” path by promptly resolving bilateral issues once the July 10 vote for Japan’s upper house is over, Yoon’s office said in a statement. 

It was their first in-person conversation as leaders. There are no plans for the two to have a formal bilateral summit at a meeting of the North Atlantic Treaty Organization, which they are both attending to show their support for the military alliance as it tries to aid Ukraine in its battle against invading Russian forces.

Yoon, a conservative who took office in May, has said he was looking to repair ties with Japan and backed regional security policies that are in line with those of Kishida’s government. This is a welcome move for Biden, who has been trying to build unity with the two allies of the US as his administration seeks to counter assertive moves from Beijing and Pyongyang that have rattled regional security.

In December 2019, then Japanese Prime Minister Shinzo Abe held a 45-minute meeting with Yoon’s predecessor, President Moon Jae-in, in Chengdu, China. The two signaled they wouldn’t let relations spin out of control even as they made little progress in resolving tensions.

Japan’s next premier, Yoshihide Suga, had a brief talk with Moon in June 2021 at the Group of Seven meeting in Britain, but they never had a formal summit.

The last time there was a three-way meeting among the US, Japan and South Korea was in September 2017 on the sidelines of the United Nations General Assembly meeting, the presidential office in Seoul said.

Disputes rooted in disagreement over whether Japan has shown sufficient contrition for its 1910-1945 colonial rule over the Korean Peninsula have hurt trade and hindered cooperation between the two on dealing with North Korea, which appears to be readying for its first test of a nuclear weapon since 2017.

©2022 Bloomberg L.P.