Fears about unrest and demonstrations in response to the final count from the April 17 election led the authorities to announce the official results earlier than expected with little advance notice.
“Jokowi”, 57, (pictured) and his vice-presidential running mate Ma’ruf Amin won 55.5 per cent of the vote, the election commission said.
Around 85.6 million Indonesians voted for Jokowi out of about 154 million voters, according to the commission’s chair Arief Budiman.
But Subianto, 67, after early results pointed to a victory for the incumbent, vowed to challenge any victory for his rival, alleging widespread voter fraud and cheating. The former general warned that a Jokowi victory could spark protests across the archipelago.
Jokowi held off declaring victory after the unofficial results last month as Prabowo insisted he was the winner.
On Friday police said they had arrested dozens of suspected militants with alleged links to so-called Islamic State amid purported plans to bomb political rallies when the election result was released.
The US embassy has also issued a travel warning advising its citizens in Indonesia to avoid demonstrations and political gatherings.
A witness for Prabowo’s campaign team refused to sign off the official results.
“We won’t give up in the face of this injustice, cheating, lies and these actions against democracy,” Azis Subekti told the media.
Prabowo has yet to announce any legal challenge.
He lost the 2014 presidential election to Widodo and unsuccessfully challenged the results in court.
Around 32,000 security officials were deployed across Jakarta, including at the election commission’s office, which was barricaded with razor wire and water cannon.
The April 17 election featured more than 190 million registered voters and a record 245,000 candidates standing for the presidency, parliament and municipal government.
Religion was a sensitive issue during the campaign.
Jokowi, a religious moderate, picked the influential, hardline cleric Ma’ruf Amin as his running mate, to head off criticism from Islamic groups.
Prabowo, meanwhile, promised to protect Islamic leaders and increase funding for religious schools.
In 2016, Jakarta’s ethnically Chinese governor Basuki Tjahaja Purnama, known as Ahok, was accused by hardliners of blasphemy against Islam. After large protests, the Christian governor was jailed for two years.
Although 80 per cent of Indonesians are Muslim, the country has no official state religion and the right to practise other faiths is enshrined in the constitution.
Joko Widodo. Picture credit: Kremlin