Millions of Jakarta voters thronged to voting booths across the Indonesian capital on Wednesday to choose a new governor in a knife-edge vote seen as a proxy battle for the 2019 presidential race and a litmus test for pluralism amid rising anti-Chinese sentiment in the world’s most populous Muslim country.

Voter turnout for the two-person run-off is expected to be more than 77 per cent of the 7.2 million eligible voters.

Polling closed at 1pm Hong Kong time in the electoral battle which pits the incumbent Basuki Tjahaja Purnama – a key government ally who is Chinese Christian – against Anies Baswedan, a Muslim backed by the opposition. President Joko Widodo declared a public holiday in the capital for the vote, and the Indonesia Stock Exchange was also shut.

Private pollsters sanctioned by election officials will release “quick count” results from a sample of ballots within hours. Official results are due for release in early May.

Purnama, 50, commonly known by his Chinese nickname “Ahok”, took over the job from Widodo in 2014 unelected after the latter triumphed in the presidential race.

Former university academic Baswedan, 47, was Widodo’s education minister before he was sacked last year.The ethnic and religious profiles of the two candidates have stoked communal tensions in the country, which is still recovering from the wounds of violent riots in the 1990s that targeted the tiny but affluent Chinese minority.

Purnama was an early favourite to win the race but is now seen as facing an uphill task as he battles the reputational damage caused by a blasphemy court case brought against him for comments he made about Islam on the campaign trail.

The straight-talking former businessman is an investor darling and has spearheaded several infrastructure projects, including an underground metro line in a city best known for its traffic jams.

His supporters and some observers say the government was compelled to prosecute him under pressure from hardline Islamist groups that oppose non-Muslims holding key political positions.

Protests against Purnama organised by these groups drew tens of thousands of people in December when he was first indicted in court, but attendance has petered out in recent rallies.

Police this week warned that groups planning mass gatherings at polling stations to “observe” the vote faced arrest.

Statistical dead heat

Polls conducted ahead of the Wednesday vote showed a statistical dead heat, with major pollsters posting results that were within their margin of error.

“It is impossible to call. The momentum during the last two weeks has been with Ahok, but his recovery may turn out to be too little, too late,” said Marcus Mietzner, an Indonesian politics expert at the Australian National University.

“This election will provide insights into whether highly organised Islamist groups can swing elections or not. It will also be an indicator of the extent to which political figures can steer Islamists for their private benefit,” he said.

Is Indonesia’s ethnic Chinese leader over the hump?

He added: “If the outcome of the elections should prove that Islamist intervention into elections can drag down a governor with a 70 per cent approval rating, this would have significant repercussions for how Indonesian electoral politics work in the future.”

Titi Anggraini, executive director of the Indonesian electoral watchdog Perludem, said a confluence of factors made the provincial electoral battle a matter of national significance.

“It is not just about the Chinese factor....On the national stage, it is the case of Ahok having the government’s backing, and Anies [Baswedan] who is largely supported by the opposition,” she said.

Baswedan is backed by the retired general Prabowo Subianto who lost to Widodo in the 2014 presidential contest. Subianto, 65, is expected to run against Widodo in 2019.

A victory for Baswedan will likely derail Widodo’s sweeping plans to spur economic growth and modernise the country’s infrastructure with the help of foreign investors including China and Saudi Arabia.

“There are concerns in Jokowi’s camp that Anies could try to delay the opening of several key Jakarta infrastructure projects, most importantly the MRT,” said Mietzner.

“A delay of only a few months, beyond the 2019 election date, could have fatal consequences for Jokowi, whose infrastructure projects are at the heart of his re-election platform.

“This is why it is so important for the president to have an ally in the Jakarta governorship, rather than a declared opponent.” Baswedan was removed from Widodo’s cabinet in a reshuffle last year seen as a move to weed out ministers who were undermining his authority.

Rock and a hard place

Other observers said Widodo – widely seen as a moderate – would be caught between a rock and a hard place if Purnama is elected. Widodo’s continued tacit support for the ethnic Chinese leader, the experts say, could cost him the support of influential Muslim organisations in the 2019 election.

Last week, the president was forced to dial back comments he made suggesting religion and politics needed to be kept separate, after the top Muslim clerical council accused him of promoting “liberal values”.

Purnama, who is of Hakka descent and speaks Mandarin, may still be convicted of the blasphemy charge if he is elected.

He is accused of telling rally-goers in the rural district of Thousand Islands in September that Muslim leaders who had told them not to vote for him were misleading them by misinterpreting a verse in the Koran. The verse – Surah al-Maidah verse 51 – is seen by some as prohibiting Muslims from electing non-Muslim leaders. Purnama has said he had no intention of insulting Islam when he referred to the verse.

What’s driving anti-Ahok Muslims to Jakarta’s polls?

The case, coupled with Purnama’s demographic profile, means “there is so much at stake politically”, said Aleksius Jemadu, a politics researcher at Indonesia’s Pelita Harapan University.

“If he wins the election, it is kind of double blow against this group. Therefore, they have been trying to do everything they can to prevent his victory,” he said.

And Mietzner the Australian academic said: “If he does scrape over the line, he’ll be badly bruised.”