My first story reporting from Indonesia was about a mob.

It was January 2018 and a group known as FPI — the Islamic Defenders Front — had marched on Facebook's Jakarta office to protest, with excessive noise and fury, against the social media giant's decision to ban a bunch of their Facebook groups for promoting hatred or violence.

Islamic Defenders Front supporters protest outside Facebook's Jakarta office after the platform shut down groups promoting hatred and violence. ( ABC News: David Lipson )

In Indonesia, we reported, the mob had moved online and was defending its turf by protesting in the real world.

It also told a deeper story percolating through so much that happens here.

First, attempts by the mob, often successful, to dictate decisions in business, courts or Parliaments. More on that later.

Loading

And second, fears the famed and glorious diversity of Indonesia's brand of Islam was being painted over by a homogenous, conservative — even intolerant and at times radical — variety.

In July last year, I covered an Islamic exorcism, known as a Rukyah ceremony.

It was performed on a former street urchin named Ucup, who retched and writhed on the stone floor.

I went into the room sceptical and came out genuinely unsettled.

It was, we were told, all part of an Islamic cleansing process, that includes the removal of all tattoos and the apparent expunging of homosexual tendencies.

Business was booming.

It's founder, Zaki, told us 50,000 people had registered for the service.

With donations flowing in, he planned to expand to three other islands.

Loading...

This creeping conservative theme popped up regularly in my time here.

From the somewhat comical — take the mermaid statues at a theme park which, after 15 years without controversy, were suddenly deemed obscene, and had their stone breasts covered in cloth.

And the much more sinister, like Meiliana, an ethnic Chinese Buddhist who complained about the volume of a mosque's call to prayer.

In response, a mob ransacked and torched more than a dozen Buddhist temples.

Those involved were never punished, Meiliana, who made the complaint, was jailed for 18 months.

Loading

There are regular examples of religion being used by the powerful against the weak.

I learned to dislike the expression "God's will" — whether uttered by parents who refused to vaccinate their children because of fears the serum wasn't halal, or by victims of disasters from Palu to Lombok and the Sunda Strait, who were told their suffering was God's will when pleas for help went entirely unanswered, until long after the voices of their loved ones trapped under the rubble fell silent.

The competing forces of Indonesia's religious character were perhaps most starkly on display in this year's presidential election.

The Islamists fell in behind the challenger Prabowo Subianto, himself not particularly devout by all accounts.

His final rally felt like a chest-beating exercise for conservative Islam.

A huge rally for Prabowo Subianto in the lead-up to Indonesia's presidential election. ( ABC News: David Lipson )

Starting before dawn with morning prayers in Jakarta's main stadium, with everyone dressed in white, it featured a cross via jumbo screen to the exiled firebrand cleric Habib Rizieq, the leader of the Islamic Defenders Front, which had protested at Facebook more than a year before.

President Joko Widodo's rallies were, in contrast, a celebration of colour and diversity.

But even this apparently progressive President had been compelled to install one of the nation's most famous conservative figures, Maruf Amin, as his vice-presidential candidate.

David Lipson covering President Joko Widodo's election rally. ( ABC News )

As chair of Indonesia's most powerful Islamic council, Maruf oversaw fatwas against religious minorities, calls for the death penalty for gay sex and the support of female genital mutilation as "a form of honour for women".

The deadly riots that followed the election were heavily tinged by religion.

So much so, that rival forces effectively laid down arms five times a day to pray.

This brings me to the other element of that first Facebook protest story.

In the thick of the violent post-election rallies, at times on the wrong side of them, I saw up close the power and resolve of the Indonesian mob.

Those involved, who'd for months been egged on by the losing candidate, truly believed they could overturn a legitimate election result through sheer numbers and determination.

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 51 seconds 51 s Protesters gathered outside Indonesia's election supervisory agency in central Jakarta.

After all, they'd done it a few years before, with Jakarta's popular Christian Governor Ahok — who was ousted and ultimately jailed after demonstrators en masse claimed he'd committed blasphemy when a doctored audio recording went viral.

In the end, the post-election protesters were repelled by the biggest and often most-violent mob of all, the state apparatus of police and the military.

But to keep the police chiefs and military brass onside, the President, had to make some big concessions.

In the lead-up to election day, he promised to allow active military members back into civilian posts, sweeping away hard-won reforms aimed at keeping soldiers out of Government.

And, more recently, allowed the appointment of a police officer, who was facing accusations of ethics violations, to lead the powerful Corruption Eradication Commission.

Critics saw it as a nod and a wink to the notoriously corrupt police force to continue its shakedowns.

At the same time, the President endorsed Parliament's revision of laws governing the commission, that were plainly aimed at stripping its independence and hobbling its ability to conduct crucial wire taps.

A violent protest we attended at the KPK, turned out to be a rent-a-crowd, who were supporting the changes, effectively campaigning for the corruption floodgates to be opened.

Loading

The Parliament was also trying to push through a complete revamp of the criminal code that could see couples jailed for sex outside of marriage and turn insults against the President into a criminal offence.

My final weeks here were filled with despair for Indonesia. It felt like all the hard-fought progress, that started with Reformasi 20 years ago, was being washed away.

Even more galling since it was all happening in the days after the death of former President BJ Habibe, the man who set Indonesia's new course, after decades of dictatorship.

The first protests we attended against all of this were, for me, disappointingly small.

The President, it seemed, was either disengaged, ill informed or powerless to stop the so-called morality laws being rammed through Parliament after years of pressure by Islamist mobs.

Then, finally, the students woke up. Tens of thousands flooded the streets.

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 1 minute 13 seconds 1 m 13 s Police sprayed water cannon and fired tear gas as Indonesians rally against new penal code

They were the spark that lit the Reformasi fire in 1998 and they weren't going to let all the blood shed back then be for nought.

So a mob of Islamists was my first story, a mob of students fighting back was fittingly my last.

And as I write this, it seems the students may have won the day — but nothing is certain.

I've found Indonesia to be a wonderous, chaotic country, where those who are meant to be in charge — right up to the President — are buffeted and bullied by whatever mob is projecting the most power at the time.

But I've found Indonesia's greatest asset remains its people — the orang kecil, the workers and of course the students, who, when the chips are down, will stand up to perhaps just save this awesome and underappreciated neighbour of ours from itself.

Listen to David Lipson's final report from Indonesia on Correspondents Report on RN's Sunday Extra