FILE PHOTO: Greek Foreign Minister Nikos Kotzias (L) welcomes his Macedonian counterpart Nikola Dimitrov at the Foreign ministry in Athens, Greece, June 14, 2017. REUTERS/Costas Baltas/File photo

ATHENS (Reuters) - Greece and Macedonia have edged closer in their efforts to resolve a decades-old dispute over the former Yugoslav republic’s name, with their foreign ministers drafting documents which could pave the way for a settlement.

Greece has long opposed Macedonia’s right to call itself that, saying it amounts to a territorial claim on a northern Greek region of the same name. The dispute has blocked Macedonia’s bid to join NATO and the European Union.

Greek Foreign Minister Nikos Kotzias said he and his Macedonian counterpart Nikola Dimitrov had concluded their talks on the issue and that the two prime ministers would take it up after some legal details had been addressed.

“The documents that have been drafted at a ministerial level will be delivered to the two prime ministers who will discuss between themselves and reach a final deal,” said Kotzias after a meeting of EU foreign ministers in Brussels. He gave no details on what had been agreed in his talks with Dimitrov.

Greece and Macedonia are racing to reach a deal before an EU summit in late June, which may open the way for Macedonia’s eventual membership.

After meeting his Macedonian counterpart Zoran Zaev in Sofia earlier this month, Prime Minister Alexis Tsipras said the two countries have covered a great part of the distance and could meet again next month if there was enough progress.