Police in Greece and Macedonia used tear gas Sunday to break up marchers against a deal settling the long dispute over who gets to use the name Macedonia.
Police in the Macedonian capital of Skopje clashed with rock-throwing protesters who tried to march on the parliament building.
Greek police also needed tear gas to disperse an angry mob in the village of Pisoderi, close to the border with Macedonia and near the town of Psarades, where the agreement was signed.
At least six people were hurt.
The Greek and Macedonian foreign ministers signed the deal Sunday with Prime Ministers Alexis Tsipras and Zoran Zaev, respectively, looking on.
The former Yugoslav republic of Macedonia would be known as the Republic of North Macedonia while Greece would stop blocking its neighbor's efforts to join NATO and the European Union.
Both countries have been feuding over the name since Macedonia the country became independent in 1991. Macedonia is also the name of an ancient historic region of northern Greece.
Many Greeks say allowing their neighbor to use the name insults Greek history and implies a claim on Greek territory.
Some Macedonians say changing their country's name or even modifying it in a deal with Greece is treason.
Both countries' parliaments must ratify the agreement and Zaev said he will also put it to a referendum. The outcome is far from certain because of opposition in both countries.