Indonesian presidential candidate Prabowo Subianto has said he rejected the election process and accused it of being unfair, as nearly complete results showed his opponent Jakarta governor Joko Widodo is leading with 52 percent of the vote.

The former general made the announcement on Tuesday after a meeting with a leader of his coalition parties while the Election Commission was finalising the tally of the July 9 election.

After meeting leaders of his coalition parties, Prabowo, declared the election undemocratic and said he was withdrawing from the current process that was underway.

Previous unofficial "quick counts" had given Widodo, a former furniture maker known as "Jokowi," a slim lead.

But Prabowo had repeatedly claimed that polling firms with links to his campaign showed that he was ahead.

About 3,400 policemen were deployed to guard the commission's building in Jakarta's town centre as commissioners and witnesses representing both sides finalised the vote count.

More than 130 million eligible voters across 33 provinces took part in the elections to choose the country's next president.