Greece's parliament on Friday ratified a landmark accord that changes the name of neighbouring Former Yugoslav Republic of Macedonia (FYROM), ending a decades-old dispute and opening the way for the ex-Yugoslav republic to join the European Union and NATO.



Prime Minister Alexis Tsipras, who hammered out the deal with his FYROM counterpart last year, secured the parliamentary majority needed to get the accord approved with support from independent and opposition lawmakers.



"Today we are writing a new page for the Balkans. The hatred of nationalism and conflict is giving way to friendship, peace, and cooperation," Tsipras wrote on his social media account.



FYROM has already ratified the deal, brokered last year, and its prime minister promptly sent a tweet hailing the Greek parliament's vote.



The settlement seeks to end a 28-year old row between Athens and Skopje over the use of the term "Macedonia" by renaming the tiny Balkan state "Republic of North Macedonia" to differentiate it from Greece's northern province of Macedonia.



Greece's European Union allies welcomed the ratification.



"They had imagination, they took the risk, they were ready to sacrifice their own interests for the greater good," European Council President Donald Tusk tweeted. "Mission impossible accomplished."



Opinion polls indicate that most Greeks oppose the settlement, a fact which may not bode well for Tsipras in an election year. A general election is due by October, and his party is trailing the opposition New Democracy by up to 12 points.



The debate in the Greek parliament was heated, with voting almost interrupted on Friday when an MP for the right-wing Golden Dawn Party, asked to cast his vote, responded: "No to treason!"



Several MPs in favour of of the accord reported attempts to intimidate them.

Many Greeks fear the agreement could lead to territorial claims against Greece and say it constitutes an appropriation of their country's ancient cultural heritage. Macedonia was the birthplace of Alexander the Great.



Protests against the deal have at times turned violent this week, and on Thursday evening police fired teargas to disperse crowds outside parliament. Smaller groups of people braved heavy rain on Friday to demonstrate outside the parliament.



New Democracy slammed the agreement.



"This deal should never have been signed or brought to parliament for ratification," party leader Kyriakos Mitsotakis told parliament. "It is a national defeat ... a national blunder that is an affont to the truth and history of our country." [Reuters]