Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Macedonia's prime minister will press ahead with plans to change the country's name, paving the way for NATO membership, despite failing to secure the minimum turnout necessary to validate a nationwide referendum result.

The change follows a deal with Greece to resolve a decades-old dispute over the country's name, which had prevented Macedonia from joining the U.S.-led alliance or the European Union.

The country is part of the Western Balkans — a region "in the line of fire" between Russia and the West, as then-Secretary of State John Kerry described it in 2015.

Sunday’s referendum asked Macedonians whether they agreed to the name change. Opponents urged followers not to vote, rather than vote no.

More than 91.5 percent voted yes, but official turnout was just 37 percent, short of the required 50 percent.

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

"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.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

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.

A referendum poster saying "Yes for European Macedonia" in Skopje. Chris McGrath / Getty Images

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 late Sunday, pro-Western Prime Minister Zoran Zaev said the votes of those who had backed the change must be respected. He pledged to hold a vote in parliament and call an early election if lawmakers failed to back his proposal.

"I am determined to take Macedonia into the European Union and NATO," Zaev said.

The U.S. welcomed the result, saying Macedonians had “expressed their support for NATO and E.U. membership,” and urged local lawmakers to back the change.

“As Macedonia’s parliament now begins deliberation on constitutional changes, we urge leaders to rise above partisan politics and seize this historic opportunity to secure a brighter future for the country as a full participant in Western institutions,” State Department spokeswoman Heather Nauert said.

Pleased PM @Zoran_Zaev intends to press ahead with parliamentary vote on #Macedonia name agreement. The boycott was a cowardly abrogation of political responsibility by @VMRO_DPMNE @MickoskiHM. They need to own their opposition to the deal and the benefits that come with it. — James Ker-Lindsay (@JamesKerLindsay) October 1, 2018

The Greek Foreign Ministry said the result respected the will of the people of Macedonia, which it refers to as Former Yugoslav Republic of Macedonia (FYROM).

Under the change, Macedonia would become 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 E.U. While polls have long showed that a vast majority of Macedonians want to join NATO and the E.U., nationalist opponents of the name change argued that it undermined the ethnic identity of Macedonia's Slavic majority.

A woman casts her vote in the referendum. Valdrin Xhemaj / EPA

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

Supporters of the name change argued that it was a price worth paying to pursue admission into bodies such as the E.U. 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 E.U., but we want to join with our heads up, not through the service door," said Vladimir Kavadarkov, who backed the referendum boycott. "We are a poor country, but we do have dignity."

The region has been in a tug-of-war between Russia and NATO for years. Russia had opposed Sunday's vote, with its ambassador saying Macedonia could become a "legitimate target" if relations between Moscow and NATO deteriorate further.

That is a concern for a country like Macedonia, which is less populous than Kansas, inhabited by just over 2 million people, and smaller in size than Massachusetts.