Jakarta - Both candidates claimed victory in Indonesia's presidential election on Wednesday, suggesting there could be a drawn out constitutional battle to decide who will next lead the world's third-largest democracy.

Just a few hours after voting closed, Jakarta governor Joko “Jokowi” Widodo said he had won, based on what are widely seen as independent quick counts of more than 90 percent of the votes. A victory for him would be seen as a triumph for a new breed of politician that has emerged in South-east Asia's biggest economy, and increase the promise of reform in government.

But ex-general Prabowo Subianto, the rival candidate seen as a representative of the old guard that flourished under decades of autocratic rule, pointed to a quick count by other pollsters naming him the winner.

He did not name the pollsters but a check by Reuters of eight agencies tallying the votes showed two put him ahead by between 1-2 percentage points. The other six showed a Jokowi win by around five percentage points.

The quick counts are conducted by private agencies which collate vote tallies as they come out of each district. The results are not official, but quick counts by three non-partisan pollsters - CSIS, Kompas and Saifulmujani - showed a Jokowi win. Their predictions were accurate in the April presidential elections.

The Election Commission will take about two weeks to declare the results officially and the new president is not due to take office until October 1.

Ahead of the vote, the two candidates had been neck and neck in opinion polls as Jokowi lost a huge early lead in the face of smear campaigns and a far more focused, and expensive, race for the presidency by his rival.

“We are thankful that according to the quick count announcements, until now, they show that Jokowi-JK at this moment in the count have won,” Jokowi told reporters and jubilant supporters in south Jakarta. JK refers to his running mate Jusuf Kalla, who was a vice president in the first term of outgoing President Susilo Bambang Yudhoyono.

His rival Prabowo countered about an hour later with the same claim.

“(The quick counts) show that we, Prabowo-Hatta, have received the support and mandate from the people of Indonesia,” he told a rally in the capital, referring to his running mate Hatta Rajasa.

There have been concerns of violence once the result is known, a worry alluded to by outgoing President Yudhoyono when he urged both sides to accept the result. But there were no reports of any violence during the voting and in the early hours of counting.

It has been the dirtiest and most confrontational campaign in memory in a country which traditionally holds up the value of consensus politics.

After the official result is declared, candidates can challenge the results in the Constitutional Court, the final arbiter over contested polls.

The Court's reputation has been badly tarnished after its chief was sentenced to jail for life this month for corruption.

“There have always been challenges...So we could end up with delayed certainty for a few weeks,” Douglas Ramage, a Jakarta-based political analyst told Reuters.

The government declared Wednesday a public holiday and markets were closed although the rupiah currency hit a seven-week high against the dollar in offshore markets on Jokowi's victory claim.

His clean image is seen likely to bring in more foreign investment as he seeks to correct Indonesia's reputation of widespread corruption.

But any euphoria in the market could quickly evaporate if the stalemate over the result is not quickly resolved.

“This is one of the most important elections in Indonesia's reformation history,” Bernard Wanandi, 37, said at a polling station in Menteng, a Jakarta suburb. “As a young generation, we have high expectations of the new leader, hoping he will bring the country forward and change the country tremendously.”

The election is being held during the Islamic holy month of Ramadaan, in the country with the world's biggest population of Muslims.

There has been growing frustration in recent years over the way Indonesia has been governed, with corruption rampant and growth slowing.

It is a sentiment both candidates have addressed in their campaigns, although they offer starkly different personalities.

Jokowi, 53 and born into poverty, has stormed his way to the top rungs of leadership with a clean image and a reputation for competence in local government, a reversal of the autocracy, corruption and power politics that have weighed down Indonesia for decades.

Prabowo, 62, ran on the promise of strong, tough leadership, playing up his military past and invoking memories of Indonesia's post-colonial and fiercely nationalist first president Sukarno, who ruled from 1945-67.

Prabowo's high-profile military career, during which he rose speedily through the ranks, unravelled quickly after the 1998 fall of long-serving autocrat Suharto, his former father-in-law. Allegations of human rights abuses during his military days have plagued his campaign, although he denies the charges and has never been taken to court for any such offences.

“I just voted for Prabowo because I've been promised by his party they will pay for my children's education. I personally like him because he is the former son-in-law of Suharto,” said housewife Titi Rahayati, 49, in the West Java city of Tasikmalaya.

The election will mark the first time a directly elected president hands over the reins to another. Outgoing President Yudhoyono, who has largely disappointed in recent years, must step down in October after serving two terms. - Reuters