Macedonia and Greece on Tuesday resolved a nearly three-decade row by agreeing to call it the Republic of North Macedonia, as Skopje hailed a "historic solution" to a dispute which had blocked its bid to join the EU and NATO.
Macedonian Prime Minister Zoran Zaev said the two sides agreed to the rename the former Yugoslav republic after months of intensive diplomacy.
"There is an agreement. We have a historic solution after two and a half decades. Our agreement includes Republic of North Macedonia for overall use," Zaev told reporters in the capital Skopje.
Greece has long objected to its northern neighbour being called Macedonia because it has its own northern province of the same name.
In televised comments, Greek Prime Minister Alexis Tsipras declared the deal "a great diplomatic victory and a great historic opportunity" for the region to have "friendship, cooperation and co-development".
Macedonia hopes that resolving the name dispute will help clear the way for it to join the European Union and NATO.
But the deal still needs to be approved by the Macedonian parliament and pass a referendum there, as well as ratification in the Greek parliament.
Tsipras insisted the Macedonian government needed to get parliamentary approval otherwise "NATO's invitation is canceled and negotiations with the EU will not move".
European Council President Donald Tusk tweeted his support for the agreement: "Thanks to you the impossible is becoming possible."
"I am keeping my fingers crossed," he said.
- Hardliners critical -
Greek officials earlier said the list of potential names included "New Macedonia" and "Upper Macedonia", but after months of discussions "North Macedonia" was chosen.
Greek Foreign Minister Nikos Kotzias had prepared a 20-page draft agreement after repeated talks with his Macedonian counterpart Nikola Dimitrov.
Tsipras said that the agreement would specify that Macedonia's language is of Slavic origin.
Both governments have faced criticism ahead of the compromise and on Tuesday Macedonia's President Gjorge Ivanov signalled his concern.
"There is a need for a wider national consensus to find a solution that won't hurt the dignity of the Macedonian people and citizens," said Ivanov.
He is close to the nationalist VMRO-DPMNE party which was defeated by Zaev in elections last year.
The party's leader Hristijan Mickoski said he would not support changes to the "constitutional name" of Macedonia.
"The government signed a capitulation because of his (the prime minister's) incompetence to lead the negotiations and he accepted every request made by Greece," said Mickoski.
This year there have been several protests against an agreement in Skopje, as well as in Athens and Greece's second city of Thessaloniki in the north.
In Greece, Tsipras' conservative rival Kyriakos Mitsotakis also denounced the deal as a "bad agreement".
"The acceptance of the Macedonian language and nationality is an unacceptable national retreat," he said.
- 'No chance' -
Greek Defence Minister Panos Kammenos, a hardline junior coalition partner in Tsipras's government, earlier dismissed talk of a deal, saying there was "no chance" Zaev could get it approved.
Skopje hopes to secure a date to begin European Union accession talks at an EU summit in late June, and an invitation to join NATO in mid-July.
"This historic agreement is testament to many years of patient diplomacy, and to the willingness of these two leaders to solve a dispute which has affected the region for too long," NATO Secretary General Jens Stoltenberg said in a statement.
"This will set Skopje on its path to NATO membership. And it will help to consolidate peace and stability across the wider Western Balkans," he added.
The EU's diplomatic chief Federica Mogherini said the deal "contributes to the transformation of the entire region of southeast Europe".
Athens has long objected to its neighbour's constitutional name -- the Republic of Macedonia -- because it fears it could imply territorial ambitions.
Ancient Macedonia was the cradle of Alexander the Great's empire, a point of pride to Greeks today.
But under the Romans, the province of Macedonia was expanded to include territory in modern-day Greece, Macedonia, Bulgaria and Albania.
Macedonian Prime Minister Zoran Zaev said the deal would end the 27-year name dispute
"It's about the name" reads graffiti on a wall in central Skopje referring to a bitter dispute with Greece over Macedonia's name
Greek Prime Minister Alexis Tsipras announced an accord that he hopes will end a long name row with Macedonia