Voters in North Macedonia braving heavy rain have begun casting ballots in the second round of a race that will not only decide the country’s new president but could determine whether the tiny state is plunged into political turmoil.

In what has become a showdown between pro-EU and nationalist forces, much depends on turnout. Before polling stations opened, speculation was rife that voter participation could fall below the 40% needed for the election to be valid, fears compounded by the weather.

A first round on 21 April only narrowly passed the threshold. The result reflected deep divisions over the former Yugoslav republic’s agreement to change its name to appease Greece – which had long claimed it connoted territorial ambitions over the Greek region called Macedonia – as part of a deal ending a three-decade row that also opened the way to EU and Nato membership.

If voter apathy again prevails and the second-round result is declared invalid, the poll will be annulled. The term of outgoing president Gjorge Ivanov, a nationalist, ends in May.

The prime minister, Zoran Zaev, who negotiated the name change accord, threatened to call snap elections if the outcome was inconclusive. Such a move could bring a protracted period of political instability for the impoverished Balkan state. At immediate stake is the nation’s long-held ambition to launch accession talks at a summit of EU leaders next month.

The two top candidates vying for the largely ceremonial post of president, university professors Stevo Pendarovski and Gordana Siljanovska-Davkova, emerged neck- and-neck two weeks ago.

Pro-western Pendarovski garnered 42.8%, while Siljanovska-Davkova, who is backed by the opposition nationalist VMRO-DPMNE party, gained 42.2%, losing by less than 5,000 votes, according to the state’s electoral commission.

The 63-year-old Siljanovska-Davkova, the first woman to run for president and a constitutional law professor, has called the name deal a blot on the nation’s dignity. She has vowed to challenge the accord before the international court of justice in the Hague despite professing support in principle for Skopje’s membership of Nato and the EU. In campaign speeches she has likened the newly renamed country to “a failed state”, saying it needs a “radical reversal”.

Blerim Reka, who was also running as representative of the nation’s large ethnic Albanian community, came in with a distant 11%. Also a university professor, Reka has not publicly endorsed either of the frontrunners, although analysts say to the race could depend on where his votes go.

Backed by the government, its junior ethnic Albanian partner and 29 smaller political parties, Pendarovski was until recently overseeing the state’s forthcoming Nato accession process. An ardent advocate of western integration in a region Russia has long regarded as falling within its own orbit, the 56-year-old has attempted to galvanise support from across the state’s ethnic divide.

Unlike their predominantly Slavic compatriots, ethnic Albanians have supported the name accord.

Pendarovski’s failure to win outright in the first round echoes mounting discontent with Zaev, who had openly appealed to voters to back the “progressive” candidate and not endorse his “destructive” opponent. Political analysts, who say economic discontent has also played a role in voters’ attitudes, have called the poll an unofficial referendum on the course his centre-left government has taken since assuming power in 2017.

“The governing coalition is paying the price of focusing on foreign policy at the expense of issues that could improve daily life,” said Eva Ellereit, who heads the Skopje office of the German thinktank Friedrich-Ebert-Stiftung. “And the rain may definitely affect turnout, although in the end the result will be swung by how [ethnic] Albanians and those who cast invalid ballots last time vote today.”

Approximately 32,000 voters, or 4.24%, cast spoiled ballots in the first round.

In a society split between pro-European and nationalist camps, anger has mounted at the sheer scale of the concessions Zaev agreed to strike the deal with Athens.

Under the historic pact, now known as the Prespes accord, the country, previously called Macedonia, agreed to designate itself North Macedonia by adding a geographical qualifier that set it apart from Greece’s own province of Macedonia.

Since declaring independence in 1991, the former Yugoslav republic had been accused by Athens of harbouring ambitions against the province, which includes the strategic warm-water port of Thessaloniki.

To ram the agreement through parliament this year, the Zaev administration, widely regarded as the country’s most western-focused government to date, made unpopular political compromises. The name change will mean everything from road signs to passports being renamed.

With about 1.8 million citizens eligible to vote, the poll was being monitored by more than 3,000 domestic and international observers.

Polling stations close at 7pm local time. If the race is tight again, a final result may not be confirmed until very late on Sunday or early on Monday.