PSARADES, Greece (AP) -- Greece and Macedonia have signed a deal that, if ratified, will resolve a decades-old dispute concerning Macedonia's name.
Under the agreement, Greece's northern neighbor will be renamed North Macedonia — move the two countries' leaders said would be the beginning of closer, friendly relations and an example to all Balkan nations. The deal will also allow Macedonia to try to join NATO and the European Union.
The two countries' prime ministers, Greece's Alexis Tsipras and Macedonia's Zoran Zaev, attended the signing of the deal Sunday by the two countries' foreign ministers, Nikos Kotzias and Nikola Dimitrov.
Also at the ceremony were U.N. Under-Secretary for Political Affairs Rosemary di Carlo, the U.N. mediator for the name dispute, Matthew Nimetz, EU Foreign Affairs chief Federica Mogherini and EU Enlargement Commissioner Johannes Hahn.
The village of Psarades, on the shores of Greater Prespa Lake, was chosen as a symbolic site, since it's near where the borders of the two countries, as well as Albania, meet.
Zaev and Dimitrov arrived by a small speedboat from across the lake and were greeted by Tsipras and Kotzias.
"This is our own appointment with history," Tsipras said, adding that the Balkan peoples have long suffered from "the poison of chauvinism and the divisions of nationalist hatred."
Recalling his first meeting with Zaev earlier this year at the World Economic Forum in Davos, Switzerland, Tsipras told Zaev that "very few believed we would succeed" in ending what he called "26 years of sterile dispute between our countries."
Zaev, on his part, hailed an "end to decades of uncertainty" and said Greece and Macedonia would henceforth be "partners and allies" setting an example for the whole Balkan region.
"We are proud of today's agreement ... may we stay as united forever as we are on this day," Zaev said.
Following the signing, the officials left by boat for the Macedonian lake resort of Oteshevo for a celebratory lunch.
Police had cordoned off all approaches to Psarades to prevent protesters from reaching the site, so more than 4,000 Greek nationalists gathered near Pissoderi, a village 40 kilometers (25 miles) away. Several hundred marched to a nearby police blockade and began throwing rocks. Police responded with tear gas and stun grenades.
Macedonian nationalists who also object to the agreement planned a rally in the city of Bitola, near the Greek border, on Sunday afternoon.
Since Macedonia seceded from the former Yugoslavia in 1991, Greece had objected to its use of the name "Macedonia" because it claimed that implied territorial designs on its own northern province of Macedonia.
Greek objections delayed U.N. recognition of Macedonia until April 1993 and then only as The Former Yugoslav Republic of Macedonia (FYROM). In 1995, the two countries signed an interim agreement after Macedonia agreed to modify its flag.