At approximately 4pm (Malaysian time), Indonesian presidential candidate Prabowo Subianto announced that he was withdrawing from the election process and would mount a legal challenge to the result, as his opponent Joko Widodo was poised to be declared the winner.

Prabowo claimed that there has been a massive, structured and systematic fraud in the 2014 elections.

So, what’s next for the race to lead the world’s third-biggest democracy?

The reform-minded governor of teeming Jakarta, Joko Widodo, was Tuesday set to be named Indonesia's next president after a bitterly fought election against a controversial ex-general with deep roots in the era of strongman Suharto.

With the election commission poised to announce the result, Widodo's arch rival Prabowo whose full name is Prabowo Subianto -- who had also claimed victory in the July 9 election -- alleged "massive fraud" and said he was withdrawing from the race.

Prabowo, 62, had been widely expected to challenge the result in the Constitutional Court if he lost, but a spokesman for his team said this was no longer an option since they had withdrawn from the whole process.

The decision removes the prospect of prolonged political deadlock, since the court would not have ruled until the end of August.

Voters faced a stark choice between governor Widodo, from a new breed of politicians without links to the autocratic Suharto era, and Prabowo, a figure from the old guard with a chequered human rights record.

If Widodo's victory is confirmed, it would cap a meteoric rise for the former furniture exporter who was born in a riverbank slum, and would be welcomed by investors who hope he can breathe new life into the economy after a recent slowdown.

With the Jakarta governor's victory looking assured, Prabowo Tuesday repeated allegations of massive cheating by his opponent and announced he was pulling out of the election process.

"There has been a massive, structured and systematic fraud in the 2014 elections," Prabowo said.

"The presidential election, organised by the (election commission), is not democratic," he told reporters, adding the commission was "not fair or transparent".

Widodo however insisted that "everything was transparent, everything was open" during the election in the world's most populous Muslim-majority nation. Independent analysts have said the poll has been largely free and fair.

The final result is expected later Tuesday when the election commission has completed checks, and a tally of almost complete votes has shown Widodo leading with more than 52 percent of the vote.

Tensions have risen sharply since polling day as each side accused the other of seeking to tamper with the votes during the lengthy counting process across the world's biggest archipelago nation.

There are fears the tension could spark unrest in a country that was hit by repeated outbreaks of violence before Suharto's downfall in 1998, and more than 250,000 police were deployed across the country on Tuesday.

Security was particularly tight in the capital Jakarta, with hundreds of police in riot gear stationed around the election commission headquarters, and roads around the centre of the capital closed off to traffic.

But police and politicians appealed for supporters not to take to the streets and by late afternoon there was no sign of major demonstrations.

Despite Prabowo's repeated accusations the coalition backing him appeared to be falling apart in recent days, with several key members reportedly conceding defeat.

Even President Susilo Bambang Yudhoyono hinted Monday that the ex-general should accept the result if he loses, saying: "Conceding defeat is noble."

Widodo was the long-time favourite to become president. But a huge poll lead he held for months dwindled to single digits during the most divisive election campaign of Indonesia's short democratic era.

However, on election day, pollsters with a track record of accurately predicting Indonesian election outcomes gave Widodo a slim but decisive lead, and only a small number of lesser-known survey institutes called a win for Prabowo.

Widodo, 53, won legions of fans during his time as Jakarta governor with his common touch, regularly making visits to the city's slums in casual clothes.

In contrast Prabowo, who won support with fiery nationalistic speeches, used to command the army's feared special forces during the Suharto era and was formerly married to one of the dictator's daughters.