"Macedonia will be called the Republic of Northern Macedonia [Severna Makedonija]", Zoran Zaev, the country's prime minister, announced Tuesday.
Greece's Alexis Tsipras and Macedonia's Zoran Zaev said the former Yugoslav republic's new name for both domestic and worldwide purposes would be Republic of North Macedonia.
Under the agreement, the agreed name, the Republic of North Macedonia, will be used internationally and domestically, an issue that was a priority for Greece.
Athens contends that the name Macedonia represents a territorial claim over Greece's northern province, also named Macedonia.
Greece had long demanded that Macedonia change or modify its name to avoid any claim to the territory and heritage of the region, the birthplace of Alexander the Great.
FYR Macedonia and Greece call it truce on the 27 year old ongoing name dispute. So even the countries that have recognized the small Balkan country as Macedonia will have to adapt the new name.
It was only with the adoption of a provisional name - the Former Yugoslav Republic of Macedonia (FYROM) - that the country was finally admitted into the United Nations in 1993.
‘Avengers: Infinity War’ Soars to $2 Billion at Worldwide Box Office
Iron Man , Thor, the Hulk and the rest of the Avengers unite to battle their most powerful enemy yet - the evil Thanos. Infinity War also holds the record for the biggest domestic debut ever with $257.7 million in its opening weekend.
Mr Tsipras said the deal met the concerns of Greece that a revised name for Macedonia be a "compound" name with a geographical qualifier. There were also rallies in Macedonia in spring, demanding the country's name to be left in place.
In September 1995 the neighbours signed an accord in NY opening the way for a normalisation of trade and political ties, but left the name dispute hanging.
'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.
Both Albania and Macedonia hope to launch full membership negotiations with the European Union. However, Tsipras said, this will be contingent on Macedonia completing the constitutional changes.
European Council President Donald Tusk tweeted his support for the agreement: 'Thanks to you the impossible is becoming possible'.
But Greek Defense Minister Panos Kammenos, whose right-wing Independent Greeks party is Tsipras' junior coalition partner, said he would reject the name agreement in a parliamentary vote. "We just saw a press conference where the defeat is shown as a fake victory", Hristijan Mickoski, president of opposition party VMRO-DPMNE said.
Greece is to ratify the deal in parliament after Macedonia has made the necessary changes to its constitution, Tsipras said.
Greek opponents of the deal say it would not go far enough.