Greece's parliament is poised to make a historic decision on Thursday night and expectation is high that it will back a deal to rename its northern neighbour.

If Greek MPs agree, the country that called itself Macedonia with the break-up of the former Yugoslavia will be called the Republic of North Macedonia.

It has taken 27 years of talks and protests continue to this day.

But the agreement has been ratified in Macedonia, and it has now reached its final stage in Athens.

Will it happen?
The arithmetic is tight but Greek Prime Minister Alexis Tsipras appears to have the numbers to win, having narrowly defeated a vote of no confidence a week ago.

Parliament began debating the deal on Wednesday. Latest opinion polls suggest two-thirds of Greek voters disapprove of the name-change deal and tens of thousands of Greeks took to the streets to protest against it on Sunday.

Why did the deal take so long?
Macedonia has long existed as a northern region in Greece that includes second city Thessaloniki. Then along came a new nation, born out of the collapse of Yugoslavia, taking its name in 1991.

Greeks, fiercely proud of the ancient heritage of Alexander the Great and his father Philip II of Macedon, were infuriated and suspected their neighbour had territorial ambitions.

For years US diplomat Matthew Nimetz searched for common ground. Resolving the name was a big part of his job, as Greece thwarted its neighbour's bids to join Nato and the EU, and Macedonia retaliated.

Eventually governments changed and a new mood emerged, culminating in the deal signed on the banks of Lake Prespa in June 2018 by Greek PM Alexis Tsipras and Macedonia's Zoran Zaev.

Macedonians backed the deal, first in a September referendum in which only a third of voters took part and then in parliament. Now the deal has gone to parliament in Athens.

What will change?
A vote to back the historic deal will mean the new name comes into force, and everyone will have to use it.

The Republic of North Macedonia, or North Macedonia in short, will replace the existing title of Macedonia, which is formally called Former Yugoslav Republic of Macedonia (or Fyrom) at the United Nations.

The language will continue to be known as Macedonian and its people known as Macedonians (citizens of the Republic of North Macedonia). In Macedonian the name will be Severna Makedonija. Greeks will know it as Voria Makedonia.

Greece will be required to back its northern neighbour's application to join Nato and the EU, a bone of contention for years.

The two countries also agree:

"On the need to refrain from irredentism and revisionism in any form" - seen as dealing with Greek fears that the Macedonians might have designs on their territory
To tackle state propaganda and incitement and agree to set up an expert panel to consider an objective interpretation of history
"The terms 'Macedonia' and 'Macedonian' refer to a different historical context and cultural heritage" - and that one is Southern Slavic and not related to ancient Greece
The new Republic of North Macedonia will "review the status" of any public buildings or monuments that refer to ancient Greek history
Is the name-change unpopular?

Greeks broadly do not like it and tens of thousands protested in the heart of Athens on Sunday against the deal.

The Greek prime minister has lost his right-wing coalition partner, Independent Greeks, because of it. Opposition New Democracy MP Giorgos Koumoutsakos said on Wednesday that the deal ignored the majority of Greeks and was a "stab in the soul of the nation".

Clashes in Greece over Macedonia name
But the number of protesters was not as big as in previous years, says Prof Dimitris Christopoulos of Panteion University, who backs the agreement.

"The rally's major political message that Macedonia is one and Greek is extremely nationalist," he says, unlike the mainstream opposition whose problem is recognising the language and nationality of their neighbours is Macedonian rather than North Macedonian.

For Macedonians it will be a question of getting used to a new name, and there is no love lost there either.

"We will have to work on our identity," says Prof Goran Janev of Sts Cyril and Methodius University in Skopje.

"Nobody can be happy about doing something because of blackmail by the international community. They allowed the Greek side for three decades to behave like spoilt brats."

Is the name row really about Alexander the Great?
Partly, yes.

Greece argues that Macedonia is an intrinsic part of Hellenic heritage. The ancient capital of Aigai is close to the modern Greek town of Vergina, while Alexander's birthplace is in Pella.

The new state of Macedonia did not help matters when it named the main airport in its capital, Skopje, after Ancient Greek hero Alexander the Great, as well as a key highway running from the Serbian to the Greek border, which in Tito's Yugoslavia was known as the Brotherhood and Unity motorway. An array of neo-classical buildings shot up, as Skopje sought a proud past.

That has stopped. The airport was renamed "International airport Skopje" last year, the Alexander the Great motorway is now simply "Friendship" (Prijatelstvo in Macedonian), and the buildings will be reviewed under the Prespa deal.

But while Alexander remains a powerful symbol, there are bitter memories from the more recent past.

When the Ottomans were driven out of the broad region known as Macedonia during the Balkan Wars of 1912-13, it was split up, mainly between Greece and Serbia, but a small part went to Bulgaria.

In World War Two, Greek and Yugoslav Macedonia were occupied by Bulgaria, an ally of Nazi Germany and Italy. Communists from both Yugoslavia and Bulgaria played a part in the Greek civil war that followed.

Macedonians too remember the expulsion of tens of thousands of citizens after World War Two.

Is there much hope for the future?
Much of the agreement is about future co-operation - on road, rail, sea and by air - as well as in industry and tourism.

And much of that already goes on on both sides.

"The biggest investor in Macedonia, despite everything, is Greece so it's already there," says Dimitris Christopoulos. "The Greek banks are still the biggest investors there. So Macedonian Greece already have rational relations and this will accelerate.

One of the big ambitions of the deal is for the establishment within a month of a "Joint Inter-Disciplinary Committee of Experts" who will investigate whether school textbooks, maps and historical atlases need revising in both countries.

"It's difficult because we never had this truth and reconciliation processes. So many things were put under the carpet," says Prof Janev.