BELGRADE (Reuters) - Macedonia’s President Gjorge Ivanov refused on Tuesday to sign an agreement on changing the country’s name to resolve a dispute with Greece, calling it a “criminal act” that violated the constitution.

FILE PHOTO - Macedonian President Gjorge Ivanov addresses the United Nations General Assembly in the Manhattan borough of New York, U.S., September 22, 2016. REUTERS/Eduardo Munoz

This month the foreign ministers of Greece and Macedonia agreed to rename the tiny ex-Yugoslav republic the “Republic of North Macedonia”, resolving a decades-old dispute that had blocked Macedonia’s entry into the EU and NATO.

Macedonia’s parliament ratified the agreement last week. But in a statement quoted by the state-run agency MIA, Ivanov said he had “no mandate to sign the agreement”, which “violated the constitution of Macedonia, and made Macedonia dependent on a third party, i.e. Greece.”

The president’s refusal to sign is unlikely to block the agreement by itself: parliament is expected to override his veto with a simple majority in a second vote.

But Ivanov’s strong words were a sign of the high political stakes in an issue that arouses passion for both Macedonians and Greeks, and could signal difficulty ahead for the government, which must still amend the constitution and has pledged to put the name change to voters in a referendum.

“Implementation of this agreement will have legal implications and therefore it represents a criminal act,” Ivanov said.

Prime Minister Zoran Zaev said he will resign if the agreement fails to get support in the promised referendum. “Macedonia has no plan B,” Zaev told 1TV.

Macedonia’s name has led to a dispute with Greece since Macedonia became independent with the breakup of Yugoslavia in the early 1990s. A Greek province is also called Macedonia, and many Greeks consider the name to be a claim to their territory.

Greece has blocked Macedonia from joining the EU or NATO, and required it to enter the United Nations as “The Former Yugoslav Republic of Macedonia”.

Nationalists in both Greece and Macedonia remain opposed to the deal, which must also be approved by the Greek parliament.