South Korean President Moon Jae-in and Prime Minister Yoshihide Suga exchanged greetings Saturday when they met on the fringes of the Group of Seven summit in Britain, a presidential office spokesperson said.

It is the first time for the two leaders to meet face-to-face. They met "accidentally" and said they were happy to see each other, according to the office.

The Japanese government said Moon approached Suga and spoke to him as the South Korean president and other guests were joining a G7 discussion.

Moon has been invited to attend part of the three-day G7 summit in Cornwall, southwestern England, as a guest along with the leaders of Australia, India and South Africa.

Although Suga and Moon held phone talks on Sept. 24 after Suga assumed the role of prime minister the same month, they had not yet seen each other in person, reflecting the soured bilateral relationship over wartime compensation issues among other matters.

The bleak state of relations between the two Asian countries, both key U.S. allies, has been a source of concern for the administration of President Joe Biden as it seeks to reinvigorate alliances and multilateralism to counter China's growing assertiveness in the Indo-Pacific region as well as security threats from North Korea.

Indian Prime Minister Narendra Modi decided to attend remotely due to the coronavirus pandemic that has hit the South Asian country hard.