Indonesian president Joko Widodo has won a second term as President, official results confirmed on Tuesday, beating former general Prabowo Subianto who has claimed widespread ballot-rigging in last month's general elections.
Joko won 55.5 per cent of the votes while his long-time rival Prabowo took 44.5 per cent, the General Elections Commission said.
Jokowi, 57, outperformed his 67-year-old strongman opponent in 21 of the country's 34 provinces, according to CNN Indonesia.
The results are in line with the early "quick count" results, which put Joko on course to win a second five-year term.
The results also mean Ma'ruf Amin, an Islamic cleric and Jokowi's 76-year-old running mate, will become Vice President.
The election commission will finalizes the results on Wednesday.
Prabowo said before the official announcement that he would reject the result.
"We are concerned about the enormous fraud committed in the general elections that we have just carried out," he said in video footage, urging supporters to stay peaceful and not resort to violence.
When Joko first took office in 2014, Prabowo slammed the election commission, citing "massive, structural and systematic cheating", and said he was withdrawing from the process.
There was heavy security and barbed-wire barricades in the capital Jakarta, where Prabowo's supporters planned to hold a rally on Wednesday, the Jakarta Post reported.
The presidential inauguration is expected to be held in October.
This year's election held on April 17 was billed as one of the most complicated single-day ballots ever undertaken. For the first time, it held its presidential and legislative elections on the same day, with more than 245,000 candidates running for over 20,000 seats.
Some 192.8 million people were eligible to vote across the archipelago's 17,000 islands, and more than 800,000 polling stations and six million election workers were involved.