Supporters of the name change rally in Tetovo, Macedonia, on Sept. 27. (Robert Atanasovski/AFP/Getty Images)

Russia and the West are battling for Macedonia’s future, and the outcome could be known as early as Sunday, when the tiny Balkan nation will vote whether to accept a name change that could unlock the door to the European Union and NATO.

The referendum has turned into the latest testing ground for Kremlin influence, Macedonian and Western officials say, as mysterious hooligans turned out to soccer matches to stir up trouble, a fleet of new websites spread calls to boycott the vote and Russia’s ambassador in Skopje warned that the country could become “a legitimate target” if tensions increased between Russia and NATO.

Pro-name-change politicians, meanwhile, warn that they have a once-in-a-generation opportunity to move westward, and they say that they should seize it.

Macedonia’s name has been the focus of an obscure but consequential dispute with Greece ever since Yugoslavia broke up in the early 1990s. Greece sees the name as a threat to its own northern regions, also called Macedonia, and in return it has blocked Skopje’s entrance into NATO and the E.U.

The nonbinding referendum asks voters to approve an effort to disarm the fight by adopting the name “Republic of North Macedonia,” in line with a deal Greek and Macedonian leaders struck in June. In exchange, Greece would drop its opposition to NATO and E.U. membership.

Polls suggest that Macedonians support the deal, but the referendum could be imperiled by low turnout. At least 50 percent of eligible voters must participate for the result to be valid under Macedonian law. President Gjorge Ivanov split from the country’s prime minister and called for a boycott of the vote this week. The main opposition party declined to take a clear stand on the vote, although it opposes the deal.

“If they vote no, Russia sees this as a huge victory,” said Michael Carpenter, who was a senior Pentagon official during the Obama administration and is now senior director of the Biden Center for Diplomacy and Global Engagement at the University of Pennsylvania. “There’s more unrest, there’s more instability in the region.”

In a sign of the stakes, high-level Western leaders have streamed to Macedonia in recent weeks, including Defense Secretary Jim Mattis, German Chancellor Angela Merkel and NATO Secretary General Jens Stoltenberg. All have encouraged Macedonians to endorse the change and start talks to join NATO.

“There is no alternative for my country than full membership in NATO and also, in parallel, full membership in the European Union,” Prime Minister Zoran Zaev said after meeting with Stoltenberg this month. “We are a small country, and we are a friendly country, and our intention is to build friendship with everybody, including Russia.”

A leaked Macedonian intelligence brief last year asserted that the Kremlin was engaged in an organized effort to prevent countries around the Western Balkans from joining NATO. Macedonian leaders said they have seen an uptick in Russian efforts to influence the discussion ahead of the vote.

One of those efforts may have involved hooligans connected to a Macedonian soccer team owned by a wealthy Russian businessman. The hooligans told local media they had been paid to stir up violence during anti-name-change protests in Skopje in June.

Separately, Greece expelled four Russian diplomats in July for alleged attempts to fan anger about the deal in the northern Greek city of Thessaloniki. The expulsions were a sharp break from Greece’s historically warm relationship with Russia.

“We have seen Russia trying to interfere in democratic political processes in this region for many years,” Stoltenberg said in an interview during his trip to ­Skopje and Athens. “I’m confident that Skopje and the people will resist these kinds of attempts to interfere.”

NATO leaders, including President Trump, approved plans in July to start membership talks with Skopje if the country backs the agreement. Trump would still have to give a final sign-off, however, and there has been some skepticism at the White House about further NATO expansion. In July, Trump said he worried that Montenegro, which joined NATO last year, “may get aggressive, and, congratulations, you’re in World War III.” (NATO members are obligated to act in one another’s’ defense, but not if a member instigates conflict.)

“Macedonia” as a place name has historically encompassed a region that includes both northern Greece and the country whose name is in dispute. But Greece says that the Slavic Macedonians do not have a claim on the heritage of the Hellenistic Alexander the Great.

When Yugoslavia broke apart, Athens forced the new country to be recognized in the United ­Nations as the Former Yugoslav Republic of Macedonia, or ­FYROM, a name the Macedonians always felt was demeaning. 

Countries typically sit in alphabetical order at the United Nations, but Greece wouldn’t let the Macedonians sit under “M,” and Skopje refused to sit under “F,” so the compromise was to sit along with the “T’s,” for “the.”

Under former prime minister Nikola Gruevski, the country erected hundreds of buildings, statues and plaques that sought to support a narrative of an unbroken historical line back to Alexander. The often-kitschy monuments were condemned by mainstream historians and many urban planners, and they infuriated Greece.

Now Zaev, a center-left reformer who came to power last year, is seeking to put the dispute behind him. And he has found an ideological colleague in Greek Prime Minister Alexis Tsipras, himself an unconventional left-wing leader more willing than his predecessors to strike a deal.

Most Macedonians support joining both the E.U. and NATO — the rare issue that unites a society deeply fractured across ethnic lines; tensions with the Albanian minority periodically flare into violence. According to a summer poll by the International Republican Institute, 83 percent of citizens supported E.U. membership and 77 percent supported NATO membership. Many opponents of the name deal say the choice is not between Russia and the West, but between NATO membership on unacceptable terms and an attempt to redo the talks.

“It’s a transgression of E.U. values. Countries should be able to pick their own name,” said Zhidas Daskalovski, the director of the Mother Teresa School of Public Policy in Skopje. “We want to be Macedonian. We don’t want to be oppressed. We want to be an independent country.”

Proponents of the deal say they hope to move on with the Westernization of their country.

“We have been stuck in the waiting room to the E.U. for a decade or more now, just because of the Greek veto,” said Ljupcho Petkovski, the director of the Eurothink Center for European Strategies, a pro-E.U. think tank in Skopje.

The referendum “will not resolve everything, but it will allow the next generations to discuss this in a more civilized manner,” he said.