Greece's Alexis Tsipras and Macedonia's Zoran Zaev said the former Yugoslav republic's new name for both domestic and international purposes would be Republic of North Macedonia. Macedonia will also amend its constitution to reflect the change as part of the deal.
The nationality of the country's citizens will be listed on official documents in English as "Macedonian/citizen of the Republic of North Macedonia," Greek officials said. NATO and European Union officials welcomed the breakthrough, which NATO Secretary General Jens Stoltenberg said would help consolidate regional peace and stability.
Greece had long demanded that its northern neighbor change or modify its name to avoid any claim to the territory and ancient heritage of the region in northern Greece named Macedonia — birthplace of ancient warrior king Alexander the Great.
The current prime ministers' attempts to end the dispute have faced dissent in both countries, leading to large protests by opponents of a compromise, threatening to split Greece's governing coalition and provoking a rift between Macedonia's prime minister and president.
And main opposition parties in both countries rejected the agreement. Zaev said the deal would be signed this weekend, and a voter referendum would be held in the fall. In a televised address, Tsipras said the 140 countries which had recognized the Balkan state simply as Macedonia would now recognize it as Republic of North Macedonia.
"This achieves a clear distinction between Greek Macedonia and our northern neighbors and puts an end to the irredentism which their current constitutional name implies," he said. He added that Macedonia "cannot and will not be able in the future to claim any connection with the ancient Greek civilization of Macedonia."
Speaking at a news conference in the Macedonian capital, Skopje, Zaev described the deal as a "historic agreement of the century." "We have been solving a two-and-a-half decade dispute ... that has been drowning the country," he said, adding that the deal "will strengthen the Macedonian identity."
On the timeline of the deal, Tsipras said that it would be first signed by the two countries' foreign ministers and then ratified by Macedonia's parliament. Greece will then back invitations for Macedonia to join NATO and start negotiations on joining the EU. However, Tsipras said, this will be contingent on Macedonia completing the constitutional changes.
"In other words, if the constitutional amendment is not successfully completed, then the invitation to join NATO will be automatically rescinded and the accession talks with the European Union will not start," he said.
The deal was welcomed by EU officials. European Council President Donald Tusk tweeted his "sincere congratulations" to Tsipras and Zaev. "I am keeping my fingers crossed. Thanks to you, the impossible is becoming possible," he said.
EU foreign affairs chief Federica Mogherini and commissioner Johannes Hahn issued a joint statement congratulating the two prime ministers "in reaching this historic agreement between their countries, which contributes to the transformation of the entire region of South-East Europe."
They said they looked forward to accession negotiations beginning with Skopje in June. The United Nations envoy who mediated the dispute for two decades congratulated Tsipras and Zaev for resolving their differences.
Matthew Nimetz said in a statement he had "no doubt this agreement will lead to a period of enhanced relations between the two neighboring countries and especially between their people." U.N. Secretary-General Antonio Guterres praised the agreement as "a demonstration of leadership to the wider region and beyond" and hopes it will inspire others involved in drawn-out conflicts "to work towards negotiated settlements without further delay," spokesman Stephane Dujarric said.
However, both prime ministers faced dissent at home. Greek Defense Minister Panos Kammenos, whose right-wing Independent Greeks party is Tsipras' governing coalition partner, said he would oppose an agreement in a parliamentary vote, meaning the left-wing prime minister will need to seek support from political opponents.
In Skopje, meanwhile, Macedonian President Gjorge Ivanov said earlier in the day that he remained opposed to writing the new name into the constitution, a move intended to show the change is permanent and binding for domestic and international use.
The main opposition party in Macedonia, the conservative VMRO-DPMNE, accused Zaev of "capitulating" to Greece. "In essence, the (deal) is acceptance of all Greek positions," VMRO-DPMNE leader Hristijan Mickoski said.
In Athens, conservative main opposition leader Kyriakos Mitsotakis urged Tsipras not to go ahead with the agreement. "This is a bad agreement that is in conflict with the majority of the Greek people," he said.
Organizers of past rallies in Greece's main cities against a compromise with Macedonia also expressed outrage at the deal, with one accusing Tsipras of "high treason." "He was Skopje's best negotiator," Michael Patsikas told The Associated Press.
This version has been corrected to show that the English translation of the country's official name, which was announced in Greek and Macedonian, will be Republic of North Macedonia, not Republic of Northern Macedonia.
Mironski contributed from Skopje, Macedonia. Nicholas Paphitis and Derek Gatopoulos in Athens, Greece, and Costas Kantouris in Thessaloniki, northern Greece, contributed.