The final tally in Indonesia's presidential election shows that Jakarta governor Joko Widodo has won with 53 per cent of the vote.

Shortly before the results of the July 9 election were released Tuesday evening by the Election Commission, Widodo's opponent, former general Prabowo Subianto, declared he was withdrawing from the contest, saying the election process was unfair and undemocratic.

INDONESIA-ELECTIONS/PROBOWO

Indonesian presidential candidate Prabowo Subianto delivers a statement to the media in Jakarta on Tuesday. (Reuters)

Figures released by the commission gave Widodo, a former furniture maker known widely as "Jokowi," 70,997,859 votes, or 53.15 per cent of the nearly 133 million valid ballots cast.

Subianto won 62,576,444 votes, or 46.85 per cent, the figures showed. Voter turnout was 70.7 per cent.

Subianto said earlier Tuesday he rejected the election process as unfair and that he was withdrawing. Subianto, who has declared assets of $140 million and was on his third bid for the presidency, repeatedly claimed that polling firms with links to his campaign showed he was ahead.

After meeting with leaders of his coalition parties Tuesday, he declared that there was massive fraud during the election and that it was undemocratic.

Indonesia election stats

"We reject the 2014 presidential election which is unlawful and therefore we withdraw from the ongoing process," Subianto said. He ordered his witnesses to leave the commission building where the officials were counting votes from the final five provinces.

The presidential campaign was Indonesia's ugliest since the Muslim majority country of 240 million emerged from the long and brutal Suharto dictatorship 16 years ago. Supporters of both men used social media for personal attacks, and Subianto's supporters led a smear campaign against Widodo, spreading unfounded rumors he is not a Muslim.

Widodo, a former furniture maker, is widely seen as untainted by the often-corrupt military and business elite that have run Indonesia for decades. He likes to wear casual plaid shirts, listen to heavy metal music and make impromptu visits to the slums.

Some 190 million people were eligible to cast ballots to choose the next president for a five-year term. It takes about two weeks to collect and tabulate votes from nearly a half-million polling stations across the country's 33 provinces.