The arrests come as tension runs high and security is tightened in the world’s third-largest democracy ahead of the May 22 announcement by the General Election Commission (KPU).
It is expected to confirm unofficial counts by private pollsters that showed incumbent President Joko Widodo winning the race over ex-general Prabowo Subianto last month.
Nearly 32,000 police and military personnel are on standby in the capital Jakarta, including troops drafted in from other provinces, to safeguard the event, national police spokesman Dedi Prasetyo said, Presstv reported.
“Through interrogation we found the suspects planned to attack mass gatherings on May 21, 22 or 23,” Prasetyo said, referring to demonstrations planned for next week.
“Their aim is to create chaos and target as many victims as possible, including police.”
The suspects belonged to Jemaah Ansharut Daulah (JAD), the largest Daesh-linked group in the country, and authorities were on the hunt for more members, he added.
Last week authorities shot dead one Islamist militant and detained six for plotting to attack police during the planned demonstrations.
Prabowo has refused to concede and his team has made accusations of “massive cheating and irregularities” in the voting and vote-counting process.
“We have won the mandate of the people,” the former special forces commander told hundreds of supporters at a campaign event on Tuesday.
“If we give up, that means we are giving in to unfairness, and that means we are betraying our own country and our people.”
His team has threatened to resort to “people power”-style street protests, although it has pledged they will be peaceful.
With more than 80% of ballots counted, Widodo is leading by 12 percentage points, with 56% of the vote, the election commission says.