Jakarta (AFP) - The reform-minded governor of Jakarta, Joko Widodo, was Tuesday declared the winner of Indonesia's presidential election after a closely-fought race against a controversial ex-general with deep roots in the era of strongman Suharto.
Dressed in a traditional patterned shirt, Widodo grinned broadly as election officials in the capital announced that he had beaten Prabowo Subianto by about six percentage points in the fight to lead the world's third-biggest democracy.
The news came after a dramatic final day to the tense election period, with Prabowo angrily accusing Widodo's team of cheating and announcing his withdrawal from the presidential race.
Both candidates claimed victory on the day of the July 9 election, despite reliable pollsters predicting a win for Widodo, who is the first Indonesian leader to come from outside the military and political elites.
After the results were announced, Widodo said his victory was "for all the Indonesian people" and urged the country to unite following the most divisive election since the downfall of Suharto in 1998.
"Let's become a united Indonesia again, a great Indonesia. We are strong because we are one, we are one because we are strong," he said in a speech delivered from a traditional wooden boat in a historic Jakarta port.
US Secretary of State John Kerry was among the first to congratulate Widodo and said he looked forward to working with him.
"The people of Indonesia united once again to show their commitment to democracy through free and fair elections," Kerry said in a statement.
- From slum to palace -
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, which is beset by slowing growth, creaking infrastructure and a corrupt bureaucracy.
Markets had been jittery about a potential win for Prabowo, due to the ex-general's fiercely nationalistic rhetoric on the campaign trail.
Prabowo, who has admitted the abduction of democracy activists back in the 1990s and used to be married to one of Suharto's daughters, made a last-ditch attempt earlier Tuesday to get the vote announcement delayed.
He claimed Widodo's team had committed massive fraud and said he was withdrawing from the election process. However the election commission did not stop their count.
Despite widespread expectations Prabowo would challenge the election results in the Constitutional Court if he lost, his team said he would not do so.
The decision removes the prospect of prolonged political deadlock because the court would not have ruled until the end of August.
Despite Prabowo's claims of cheating, independent analysts in the world's most populous Muslim-majority nation have said that the poll has been largely free and fair.
It was not clear what his next step might be following his defeat.
His coalition appeared to be falling apart in recent days, with several key members reportedly conceding defeat, and President Susilo Bambang Yudhoyono even hinted that he should concede defeat.
- Polarising election campaign -
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 only a few small demonstrations were reported, and the day passed off peacefully.
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 polarising election campaign.
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, with almost 71 million votes. This compared to 46.85 percent for Prabowo, who received more than 62 million votes.
During his time as Jakarta governor, Widodo regularly made visits to the city's slums in casual clothes and introduced a series of policies aimed at helping the poor.
However some observers point out that running the sprawling archipelago will be a far from easy task for the slightly-built, softly-spoken man who has no experience in national politics.
Widodo will be inaugurated as president in October, when Yudhoyono steps down after a decade in power.