A woman casts her vote at a polling station on September 30, 2018 in Tetovo, Macedonia. Macedonians all across the country went to the polls on Sunday to vote in a referendum to change the country's name to the 'Republic of North Macedonia' and end a long running dispute with Greece.

Macedonia's prime minister pledged on Sunday to press on with a vote in parliament to change the country's name to resolve a decades-old dispute with Greece, despite failing to secure the 50 percent turnout at a referendum required to make it valid.

The proposed name change is part of an agreement reached in June by pro-Western Prime Minister Zoran Zaev with Greece to resolve the dispute over the country's name, which had prevented Macedonia from joining NATO or the EU.

With 85 percent of votes counted, official turnout was just 36 percent, and election officials made clear there was no chance the threshold would be cleared.

"On this referendum, it is clear that the decision has not been made," election commission head Oliver Derkoski told reporters.

The people who did vote overwhelmingly backed the name change -- more than 90 percent voted yes with 63 percent of polling stations reporting. But that had never been in doubt, since opponents of the change had urged followers not to vote, rather than vote no.

"It is clear that the agreement with Greece has not received the green light from the people," main nationalist opposition VMRO-DPMNE party leader Hristiajn Mickoski told journalists.

The referendum was itself not legally binding, but lawmakers had pledged to abide by it, and the failure to reach the turnout threshold means opponents can now freely vote against the deal.

The nationalist opposition holds 49 seats in the 120-seat parliament, enough to block the two-thirds majority required to change the constitution.

In an address, Zaev made no mention of the turnout but said the votes of those who had backed the change must be respected. He pledged to hold a vote in parliament on the name change, and call an early election if lawmakers failed to enact it.

"I am determined to take Macedonia into the European Union and NATO," Zaev said. He spoke again later in the evening, along similar lines: "It is time to support European Macedonia."

Blow

The Greek foreign ministry said it respected the will of the people of the country, which it refers to by the provisional name Former Yugoslav Republic of Macedonia.

The referendum passed judgment on the agreement with Greece reached in June, under which Macedonia would change its name to the Republic of North Macedonia.

Greece, which has its own province called Macedonia, maintains that its northern neighbor's name represents a claim on its territory.

Because of the dispute, Greece has vetoed Macedonia's entrance into NATO and the EU. While polls have long showed that a vast majority of Macedonians want to join NATO and the EU, nationalist opponents of the name change argued that it undermined the ethnic identity of Macedonia's Slavic majority.

The question on the referendum ballot read: "Are you for NATO and EU membership with acceptance of the agreement with Greece".

ROBERT ATANASOVSKI/AFP/Getty Images

People wave Macedonian flags during a protest in front of the Government building in Skopje on June 2, 2018.

Supporters of the name change argued that it was a price worth paying to pursue admission into bodies such as the EU and NATO.

"I came today to vote for the future of the country, for young people in Macedonia so they can be live freely under the umbrella of the European Union because it means safer lives for all of us," said Olivera Georgijevska, 79, in Skopje.

But opponents said the name change represented national humiliation.

"We are for NATO and EU, but we want to join with our heads up, not through the service door," said Vladimir Kavadarkov, who backed the referendum boycott.