ATHENS (Reuters) - Greek Foreign Minister Nikos Kotzias on Thursday hailed an agreement with Macedonia on changing its name and opening the way for it to join NATO and the European Union.

Greek Foreign Minister Nikos Kotzias speaks during a news conference with his German counterpart Heiko Maas (not pictured) following their meeting at the Foreign Ministry in Athens, Greece, September 20, 2018. REUTERS/Costas Baltas

“History should be a school and not a prison,” Kotzias told reporters after a meeting with German Foreign Minister Heiko Maas in Athens. “This accord took us out of prison.”

Macedonians will vote on Sept. 30 on a deal reached with Athens in June that would change their country’s name to the Republic of North Macedonia.

Greece’s northern neighbor currently calls itself the Republic of Macedonia but, because of the dispute with Greece, is provisionally recognized at the United Nations as the “Former Yugoslav Republic of Macedonia”.

Athens had long objected to its use of the name Macedonia, arguing that it, along with contentious articles in the country’s constitution, could imply territorial claims over Greece’s own northern region named Macedonia.

Greece insisted on the name change in return for lifting its opposition to Skopje joining NATO and the EU, a row which has bedevilled the two states’ relations for more than two decades.

Both ministers on Thursday said the deal added to stability and security in the Balkans.

“This is a historic opportunity,” Maas said. “I hope that this historic accord will be implemented.”

NATO has invited Macedonia to begin accession talks with the alliance, but says it must first change its constitution.

Under the deal, the constitution must be amended to adopt the new name, and it must be used in all international organizations.

The two countries have also agreed that amendments will be made to the constitution to make clear Skopje’s use of the terms “Macedonia” and “Macedonian” does not refer to ancient Greek civilization, or the history and culture of Greece’s Macedonia region.

The EU has also said it will set a date for Macedonian accession talks pending implementation of the deal.

Kotzias said the Greek parliament would vote on the deal and on Macedonia’s accession to NATO immediately after the constitutional changes are implemented, most likely in January.

Greece’s left-led governing coalition is backed by 153 lawmakers in the 300-seat parliament and opposition parties, including the conservatives, have vowed to vote against the agreement with Skopje.

The leader of the ruling coalition’s junior partner, the Independent Greeks party, has also said he will not back the government in a vote in parliament, fuelling fears of a snap election in a country which has only just emerged from its third international bailout.

Kotzias brushed off criticism, saying he was certain that if Skopje delivered the required constitutional changes, the deal would pass in parliament, with the backing of center-left and independent lawmakers.

“We need a majority of lawmakers, not a majority of parties,” Kotzias said. “The majority (of lawmakers) for the approval of this deal is there.”