(Bloomberg) -- Indonesian authorities are bracing for a wave of opposition protests and potential terrorist attacks before the Southeast Asian country unveils the official result of last month’s presidential election on Wednesday.

Challenger Prabowo Subianto has vowed to reject a verdict that is set to confirm the re-election of Joko Widodo, who is widely known as Jokowi. The opposition has said it will protest the result, even after police appealed for people not to participate in rallies because militants linked to the Islamic State were plotting to use the gatherings to launch attacks.

More than 45,000 armed police will guard the main offices of the General Elections Commission and the Election Supervisory Board in central Jakarta and other government offices, according to police spokesman Argo Yuwono.

With an official online tally of the votes from the April 17 elections pointing to Jokowi’s re-election by almost 11 percentage points, Prabowo, as Subianto is commonly known, has repeatedly alleged voter fraud and counting irregularities. The former general, who lost to Jokowi in 2014 and unsuccessfully mounted a legal challenge back then, has urged his supporters to spurn the official result and “carry on the fight for justice.”

The threat of unrest may add to investor anxiety as an escalating U.S.-China trade war and a slowing global economy cloud growth prospects in the region’s largest economy. Jokowi is already facing a widening trade deficit and fallout from global trade tensions that are complicating efforts to sustain economic growth.

Plotting Attacks

Police arrested two dozen militants linked to Islamic State this month for plotting attacks on rallies during the announcement of the poll result.

Most of the 29 suspects detained were former IS militants, who fought in Syria and are members of local terror group Jamaah Ansharut Daulah, according to National Police spokesman Mohammad Iqbal. These groups consider democracy to be forbidden by Islam, police said.

Still, Prabowo supporters are mobilizing people across the country for rallies, the Jakarta Post reported. And the presidential challenger may lead a protest outside the election agency’s office on Tuesday or Wednesday, the Tempo newspaper reported.

The protests are “kind of a stress test that proves the resilience of the Indonesian democracy,” according to Greg Barton, a professor of global Islamic politics at Deakin University in Australia.

He expects, however, the public is unlikely to get behind Prabowo in the same way people supported massive protests in 2016 that called for the jailing of Jokowi’s ally and former Jakarta Governor Basuki Tjahaja Purnama on blasphemy charges. These protests may die down quickly given the likely scale of Prabowo’s loss, Barton said.

‘Divisive Election’

The election campaign exposed deep religious divides among conservatives and moderates in the world’s largest Muslim-majority nation. Many liberals backed Jokowi, who chose senior cleric Ma’ruf Amin as his running mate to counter opposition attacks on his religiosity.

Jokowi won in regions with diverse religious populations with more tolerance for pluralism, while Prabowo triumphed in provinces with higher-than-average Muslim majorities and more “purist” societies, according to Achmad Sukarsono, a Singapore-based senior analyst at consultancy Control Risks, who called it "the most divisive election in Indonesia’s democratic history."

“Jokowi will have to placate some pro-Prabowo Muslims and likely concede to soft demands from the Islamic community, such as an equitable economy that is more congruent with Sharia principles,” Sukarsono wrote in a report. “It is therefore unlikely that Jokowi will be able to prioritize the rights of minorities, or risk being perceived as overly friendly towards foreign businesses.”

Prabowo’s Gerindra party is on track to win about 12% of the national vote in the parliamentary polls, trailing only Jokowi’s Indonesian Democratic Party of Struggle and Golkar, which helped keep authoritarian leader Suharto in power for more than three decades.

For Jokowi, the immediate challenge will be to revamp his cabinet after three ministers were linked to graft cases by the Corruption Eradication Commission. He hinted cabinet changes could come as early as next month, and has vowed to pursue tougher economic reforms now that he’s freed up from campaigning.

After results are clear, there’s likely to be a a bit of a “bounce” in investor confidence and the broader economy, Barton said. “If investors are looking objectively and they compare Indonesia with the Philippines or Thailand, actually it’s altogether more stable in Indonesia,” he said.

To contact the reporters on this story: Arys Aditya in Jakarta at aaditya5@bloomberg.net;Karlis Salna in Jakarta at ksalna@bloomberg.net

To contact the editors responsible for this story: Thomas Kutty Abraham at tabraham4@bloomberg.net, Iain Marlow, Ruth Pollard

©2019 Bloomberg L.P.