TEHRAN, Young Journalists Club (YJC) -The election commission had been due to give the final tally of the divisive poll on Wednesday, but the results were revealed early Tuesday with little advance notice amid fears of unrest.
Presidential challenger Prabowo Subianto had warned of possible mass uprisings in response to his claims of widespread cheating.
Tensions have also spiked high since police said last week that they arrested dozens of Daesh-linked terror suspects — including some who planned to cause chaos by detonating bombs at any post-election protests.
On Friday, the US Embassy in Jakarta issued a heightened security alert for Indonesia, the world's biggest Muslim-majority nation.
There was a heavy security presence in Jakarta on Tuesday, including in front of the elections commission office, which was barricaded with razor wire and protected by scores of heavily-armed troops.
Subianto, a 67-year-old retired general, has targeted the commission by accusing it of allowing a string of election violations.
The former military man — who has strong ties to the Suharto dictatorship that collapsed in 1998 — has kept up a steady string of rhetoric since unofficial results for the April 17 poll put bitter rival Widodo ahead by a wide margin.
Widodo, who had held off declaring victory after last month's polls, confirmed the win Tuesday.
"After we're sworn in... we will be president and vice president," Widodo told reporters in Jakarta with running mate Maruf Amin, a Muslim cleric, at his side.
Subianto, meanwhile, rejected the results but called for supporters to remain calm and said his camp would pursue "legal avenues."
Earlier Tuesday, Subianto's legal director was quoted by Indonesian media as saying a formal appeal would be filed at the Constitutional Court.
Subianto unsuccessfully challenged Widodo's 2014 victory over him at the same court.
'Attempting to sway public opinion'
Analysts and election officials have discounted Subianto's claims that the result was affected by voter fraud and widespread cheating.
"The scale of abuses and errors in the conduct of the election are clearly very minor overall," Jakarta-based political analyst Kevin O'Rourke said before Tuesday's official results.
"[Subianto] and his camp are harping on minor deficiencies and very micro problems, clearly in an attempt to sway public opinion and delegitimize Widodo."
It was unclear if huge crowds would flood the streets to support Subianto, but there was little sign on Tuesday.
"There will be protests from disappointed (Subianto) supporters but I don't think it'll be significant," said Syamsuddin Haris, a political analyst at the Indonesian Sciences Institute.
"Authorities have been anticipating this," he added.
Widodo and Amin won the country's top jobs with 55.5 percent of the vote against 44.5 percent for Subianto and his wealthy financier partner Sandiaga Uno, the commission said Tuesday.
Some 85.6 million votes were cast in favor of Widodo out of about 154 million in total, it added.
Widodo scored thumping victories in holiday hotspot Bali and heavily-populated East Java, while Subianto landed big wins in conservative Aceh and West Java.