The reform-minded governor of Jakarta, Joko Widodo, has convincingly won Indonesia's closely-fought presidential race against a controversial ex-general with deep roots in the era of strongman Suharto, final results showed Tuesday.

Widodo, who will be Indonesia's first president without some kind of link to the autocratic past, won 53 percent of the vote compared to 47 percent for Prabowo Subianto, according to figures from the election commission in the world's third-biggest democracy.

The news came after a dramatic final day to the country's most divisive election period since the end of the Suharto era in 1998, with Prabowo angrily accusing Widodo's team of committing fraud and announcing his withdrawal from the presidential race.

Widodo's victory caps a meteoric rise for the former furniture exporter, who was born in a riverbank slum and won legions of fans with his common touch during his time as Jakarta governor.

It will be welcomed by investors who hope the 53-year-old can breathe new life into Southeast Asia's biggest economy after a recent slowdown.

Investors had been jittery about a potential win for Prabowo, a figure from the old guard with a chequered human rights record.

Social media was already abuzz with comments congratulating Widodo, nicknamed Jokowi.

"Indonesia will be a better nation under Jokowi, God bless," wrote one Twitter user with the name Prettyinpink69.

But there was an equal amount of anger directed at Prabowo -- who has admitted the abduction of democracy activists back in the 1990s and used to be married to one of Suharto's daughters -- for his refusal to concede defeat.

"Almost bored to death watching cry baby Prabowo whining," tweeted Husein Soebagyo.

The 62-year-old had been widely expected to challenge the result in the Constitutional Court if he lost, but -- before the final results were made public -- 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 because the court would not have ruled until the end of August.

Speaking to reporters earlier in Jakarta, Prabowo claimed there had been "a massive, structured and systematic fraud" in the 2014 elections.

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.

It was not clear what Prabowo's next step might be following his defeat.

Tensions rose sharply after election 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 were fears the tension could spark unrest in a country that was hit by repeated outbreaks of violence before Suharto's downfall, and more than 250,000 police were deployed across the country on Tuesday.

However by early evening there were no reports of major demonstrations or unrest.

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.

Nevertheless unofficial tallies released by reliable polling agencies on election day showed him with a decisive lead, and the final results were in line with these counts.

The official results showed Widodo had received 53.15 percent of the vote, more than 70 million votes. This compared to 46.85 percent of the vote for Prabowo, who received over 62 million votes.

Several polling institutes did call a win for Prabowo on election day, but their results were called into questions.

Widodo won huge popularity when he was in charge of Jakarta, regularly making visits to the city's slums in casual clothes and introducing a series of policies aimed at helping the poor.

He will be inaugurated as president in October, when Yudhoyono steps down after a decade in power.