JAKARTA: Indonesia pulled off a complex yet peaceful election across its vast — and ethnically diverse — island territory this week, cementing its place as a democratic beacon in a sea of authoritarian governments, analysts say.

But the world’s biggest Muslim-majority nation still faces a spike in militancy and myriad other challenges.

On Wednesday, the sprawling Southeast Asian archipelago saw as many as 190 million voters cast ballots to elect a new president, parliamentarians and local legislators, in a one-day contest with a record 245,000 candidates.

Preliminary results appeared to hand a second term to President Joko Widodo, but he held off declaring victory pending official results next month.

However, his rival ex-general Prabowo Subianto — who has strong ties to the Suharto dictatorship that collapsed in 1998 — insisted he won, and vowed to challenge the results.

He did the same, unsuccessfully, after losing to Widodo in 2014 and there is little to suggest Subianto will win this latest fight.

Despite the lingering uncertainty, Indonesia’s democratic feat still stands in stark contrast to strongman governments in the Philippines and Cambodia, authoritarian Vietnam and Laos, Myanmar’s stumbling post-junta steps and a chaotic election in Thailand, its first since a 2014 coup.

“In a region that is not inclined towards democracy, where authoritarianism is on the rise, Indonesia’s democracy really has weight — even if it is turning more conservative,” said Christine Cabasset at the Bangkok-based Research Institute on Contemporary Southeast Asia.

‘Slow erosion’

In a nod to voter participation, one reputable pollster recorded 82 per cent turnout in this week’s polls, the highest since 2004 legislative elections, local media reported.

“People are voting and making a difference. Indonesians have embraced their own electoral power, especially younger voters,” said Bridget Welsh, a Southeast Asia expert at John Cabot University in Rome.

“This bodes well for greater demands for better governance,” she added.

Still, Welsh was sharply critical of Widodo’s rights records, and there are doubts about whether the 57-year-old will use his political capital to safeguard two decades of democratic progress that some fear is being undermined.

“My prediction over the next five years is that we will continue to see a slow erosion of democratic quality,” said Marcus Mietzner, an associate professor at the Australian National University.

“(But) not a full push into authoritarianism,” he added.

Widodo himself has been accused of creeping authoritarianism following arrests of opposition campaigners under a controversial electronic defamation law, while a decree during his tenure allowed Jakarta to ban mass organisations.

Others have raised concerns about the renewed influence of the military, which is eyeing more civilian government positions in the country of 260 million — home to hundreds of ethnic groups and languages.