Jakarta’s popular Chinese-Christian governor looked set for a crushing defeat in polls on Wednesday that pit him against a Muslim rival and put the country’s pluralism under scrutiny.

A quick count of a representative sample taken from 69 per cent of ballots cast showed Basuki “Ahok” Tjahaja Purnama was trailing his opponent Anies Baswedan by a score of 42.61 per cent to 57.39 per cent.

Voting in over 13,000 polling stations across the national capital closed at 1pm after opening six hours earlier.

Two polling observers told the This Week in Asia that counting so far appeared to point towards a Baswedan victory.

Will Islam swing nail-biter election for Jakarta’s governor?

“Don’t let any cheating happen, because the future of Jakarta is determined by the election today,” Purnama, known commonly by his Chinese nickname “Ahok” told reporters after casting his vote with his family in north Jakarta, local media reports said.

The electoral battle – a two-person run-off following a first round in February – stoked communal tension because of the profile of the candidates. Purnama, a member of the tiny but affluent Chinese community, is a key ally of President Joko Widodo. Baswedan, an academic and former education minister, is backed by the opposition and major Muslim groups.

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

Purnama was an early favourite but his popularity plummeted after authorities brought blasphemy charges against him late last year for comments he made about Islam on the campaign trail. Purnama’s supporters say prosecutors filed the charges under pressure from Islamist groups that do not want to see a non-Muslim hold a key political position. Purnama became governor in 2014 after his predecessor Widodo became president.

Baswedan was appointed education minister by Widodo in 2014 but he was sacked last year in a reshuffle seen by observers as a move by the president to weed out ministers undermining his authority.