Indonesians voted Wednesday in the tightest and most divisive presidential election since the downfall of dictator Suharto, pitting Jakarta governor Joko Widodo against Prabowo Subianto, an ex-general with a chequered human rights record.
After a bitterly fought campaign that saw long-time favorite Widodo's lead shrink dramatically, voters in the world's third-biggest democracy must choose between two starkly different candidates.
A former furniture exporter from a humble background, Widodo, known by his nickname Jokowi, is the first serious presidential contender without links to the authoritarian past. Should he win, he is seen as likely to usher in a new style of leadership and consolidate democracy.
Prabowo, a former son-in-law of Suharto who has admitted ordering the abduction of democracy activists before the strongman's downfall in 1998, has won support with promises of firm leadership in a country where many yearn for a strong figurehead.
But critics fear he may shift Indonesia back towards authoritarian rule.
Some 190 million voters are eligible to cast ballots across the sprawling archipelago of more than 17,000 islands, that spreads across three time zones.
Polling stations opened first in eastern Papua, then on the main island of Java and jungle-clad Sumatra in the west.
"I voted for Jokowi because I think he's made himself close to the people and he also came here to Papua to campaign," said Katharina Utomo, a 38-year-old housewife, as she cast her ballot in the eastern province.
Samsul, who works at a children's park, voted for Prabowo near the candidate's countryside house outside Jakarta.
"Once he is president I hope he keeps his promises to bring welfare to the people, to give us proper healthcare and education," said the 21-year-old, who like many Indonesians goes by one name.
Several months ago Widodo looked to be on a smooth course to lead the country. But, after a polarizing campaign, hid once-huge lead has shrunk.
The Jakarta governor was targeted by smears, including a claim that he is an ethnic Chinese Christian and not a Muslim, a deeply damaging charge in the world's most populous Muslim-majority country.
He vehemently denied the claim.
A poll out Tuesday gave him a lead of just 2.7 percentage points, and with a large number of undecided voters, analysts say the race is wide open.
A series of "quick counts" by pollsters are expected to give an accurate indication of the winner. Official results are not expected for about two weeks.
Whoever wins will be the country's second directly elected president after Susilo Bambang Yudhoyono, who steps down in October after a decade of stable but often indecisive rule.
It will be a delicate transition. Growth is slowing in Southeast Asia's top economy, corruption is rampant, millions remain mired in poverty, and fears are mounting that Islamic radicals returning from Middle East conflicts could revive militant networks.
Widodo, 53, shot to national prominence when he was elected Jakarta governor in 2012, and quickly won legions of fans with his common touch and efforts to solve the capital's myriad problems.
He would make regular tours of the metropolis's sprawling slums in casual clothes and was often spotted at heavy metal concerts.
Roots in authoritarian past
Prabowo, a 62-year-old wealthy businessman, has played up his military background on the campaign trail, at a time when nostalgia is growing in some quarters for a return to the strong rule of the Suharto years.
Many have become disillusioned with the country's chaotic democracy, and hope a stronger leader can crack down on corruption in one of the world's most graft-ridden nations.
But Prabowo's comments about democracy have caused concern -- in one recent talk, he reportedly said that a Western-style political system, including direct elections, "doesn't suit" Indonesia.
Investors are hoping for a Widodo win, seeing him as a potential reformer, and the rupiah has fallen heavily in recent weeks as Prabowo has gained ground.
Organizing elections in Indonesia is a huge logistical challenge, with ballots taken in speedboats out to remote islands, carried on horseback along mountain paths, and in helicopters and small planes to far-flung hamlets.
Around 250,000 police have been deployed across the archipelago for the election amid fears that the close race could spark unrest.