Early announcement by elections commission comes hours before expected opposition protests challenging the results.

Indonesia‘s President Joko Widodo has beaten rival Prabowo Subianto to win a second term in office, the country’s elections commission has said, in an announcement that came hours before opposition protesters were set to protest against the final results of last month’s vote.

The commission was expected to announce the official results on Wednesday but, in a surprise move, it released the final tally early on Tuesday amid fears of unrest after Prabowo vowed to challenge any victory for the incumbent leader.

Widodo – widely known as Jokowi – and his vice-presidential running mate, Ma’ruf Amin, won the April 17 election by a 55.5 percent to 44.5 percent margin over Prabowo and Sandiaga Uno, the commission said.

“This ruling was announced on May 21 … and will be effective immediately,” the commission’s chair Arief Budiman said in a live-streamed announcement that was broadcast on major media.

But a witness for Prabowo’s campaign team and the leading opposition party refused to sign and validate the official results, which were announced with little advance notice.

“We won’t give up in the face of this injustice, cheating, lies, and these actions against democracy,” Azis Subekti, a witness from Prabowo’s campaign team, was quoted as saying by Reuters news agency.

Later on Tuesday, Sufmi Dasco, an official at Prabowo’s campaign team, said the presidential candidate would challenge the official election result in the Constitutional Court.

Arief Budiman talks to reporters after the announcement of the results [Willy Kurniawan/Reuters]

Widodo, 57, had been widely predicted to win, according to unofficial results.

But Prabowo, a 67-year-old retired general, alleged widespread voter fraud and warned that it could lead to street demonstrations across the world’s biggest Muslim-majority nation.

Some 32,000 security personnel were being deployed across the capital, Jakarta, including in front of the General Elections Commission’s central office which has been barricaded with razor wire.

190428131258785

Last month, Indonesia held its biggest-ever election, a massive one-day poll featuring more than 190 million registered voters and a record 245,000 candidates vying for the presidency, parliamentary seats and local legislator positions.

The campaign was characterised by bitter mudslinging and a slew of fake news online – much of it directed at the presidential contenders.

Widodo held off declaring victory after the unofficial results last month as Prabowo insisted he was the winner.

Prabowo lost a 2014 presidential bid to Widodo which he unsuccessfully challenged in court.