ANALYSIS: The high-pressure climax to a blasphemy trial in Jakarta involving the city's Christian Chinese governor has laid bare some of the forces at work in Indonesia, and the perilous nature of democracy in the world's largest Muslim nation.
Basuki Tjahaja Purnama, known by Indonesians as Ahok, now faces two years in jail if his appeal is rejected, as it is expected to be.
The concept of blasphemy against the Koran is taken very seriously by most Muslims - in this case the governor was tripped up by a simple warning to his supporters not be swayed by those who suggest the Koran bans Muslims from voting for non-muslims.
It sparked street protests involving hundreds of thousands of Indonesians, some of them Ahok supporters, but the majority were those who opposed him - in some cases vehemently calling for his execution.
And as an election strategy it was hugely effective, emboldening the hand of hardline Muslim organisations like the Islamic Defenders Front (FPI), whose white-clad supporters launched a campaign of disinformation against Ahok and the Chinese community in general.
This included claims that millions of Chinese were to be allowed into Indonesia illegally, that those who voted for Ahok would not be buried in Muslim cemeteries, and that Ahok was a Chinese spy.
The result was a populist mood developing in Jakarta similar in many ways to that in the US and Europe, and victory to muslim candidate Anies Baswedan.
And it's a sign of the increasing intolerance, in a nation built on the very opposite.
"There's been a slow decline in religious freedom," said Human Rights Watch advocate Andreas Harsono. "Here in Jakarta it's just been really blatant during the whole Ahok trial, and it's on the increase."
He said he was also concerned about the increase in blasphemy trials in recent years: "Under General Surharto there were virtually none, in the last decade there have been more than 250."
The protests against Ahok and the blasphemy charges against him are seen by some observers as a fairly thin political veil over a more important aim - the neutralising of the president himself, along with his liberal coalition, which contains a number of non-muslims.
While the FPI only appeared in 1998, groups like it have been present across Indonesia since independence in 1945.
FPI supporters have waved black ISIS flags at political rallies, and many openly support both IS and Al Qaeda.
Their funding is murky, but the FPI take a great deal of support from retired military figures, some of whom see the Jokowi administration as too liberal, too "communist", too anti-army, and not Islamic enough.
Chief among these is Indonesia's notorious general Prabowo Subianto, who lost to Jokowi in the 2014 poll.
Prabowo crushed the bloody 1998 Jakarta rioting that led to the resignation of his then father-in law, Suharto. He was then thrown out of the army, after admitting responsibility for kidnapping 13 activists, who were never found.
For Mr Harsono, the FPI stood equal with militant extremist group Jemaah Islamiyah (JI) in its threat to Indonesia.
Following the Bali bombing, the crackdown on JI was brutal and sustained across the region, but Mr Harsono and others have seen the recent re-growth of the group, as some of its leaders emerged from lengthy jail terms, and looked to recruit a new generation.
"JI is growing, they now have more than 60 Muslim schools under their influence," said Mr Harsono.
He said it was not just the violent groups that were the concern, it was also the Islamist radical groups who were clever enough to learn the lessons, and avoid a violent path.
"They have their base in the universities, the high schools, the military, and they are becoming the king-makers," he said.
Certainly pressure from groups like the FPI has the attention of Indonesian President Joko Widodo, and while he may be a muslim, the calls for him to step down have grown among the right wing and the numerous populist Islamic groups.
This week the government banned Hizbut Tahrir, a group not involved in violence, but often present at its fringes, and a promoter of sharia law.
Senior Minister Gen Wiranto told reporters: "We want to prevent the embryo from growing, and disrupting public order, and disturbing the existence of a country that is trying to achieve prosperity and justice."
But in the Jakarta court the legal team battling for Ahok told reporters it was exactly that sense of justice in Indonesia that was being tested.
Lawyer Sirra Prajuna said Ahok's predicament was a challenge to the Indonesian identity.
"Indonesia is a pluralist nation with respect for all faiths," she said. "We cannot let this case sink the dream of the founders of this country, or kill our national motto 'Bhinneka Tunggal Ika'."
The motto translates as "Strength Through Diversity" - and underpins what many in the Asia-Pacific perceive to be a "secular Islamic" nation.
"New Zealand needs to watch closely what is actually happening in Indonesia" said Mr Harsono. "New Zealand has always praised Indonesia as a secular power, but things are changing here, and quickly."
Jokowi is up for re-election in 2019, when he will face the same political forces that eventually saw Ahok's political career destroyed.
And Mr Harsono has this warning: "There remains the possibility radical islamist elements and the more authoritarian ex-military side could come together, to form a party that would truly concern New Zealand and Australia"