Indonesia's Joko Widodo was on track to be re-elected leader of the world's third-biggest democracy as unofficial results put him in a comfortable lead over firebrand ex-general Prabowo Subianto after voting closed Wednesday across the 17,000-island archipelago.
While official results are not due until next month, a series of so-called "quick counts" by pollsters showed Widodo as much as 11 percentage points ahead.
The vote ended at 1:00 pm (0600 GMT), but some of the 800,000 polling stations across the volcano-dotted nation remained open late due to delays and long queues.
The quick counts have been reliable indicators in past elections, but Widodo held off declaring victory - while his rival insisted he had won.
"We've all seen exit poll and quick count numbers, but we still need to wait for the official results," Widodo told cheering supporters in Jakarta.
The 67-year-old Subianto - who warned of street protests and legal challenges if he lost - insisted that he was Indonesia's next leader, without citing specific evidence.
"We will not use illegal tactics because we have won," Subianto said.
"For those who defended (my rivals), I'm still going to defend you. I'm the president of all Indonesians," he added.
Subianto, who has long had his eye on the country's top job, lost to Widodo in 2014 and then mounted an unsuccessful legal challenge to the election.
This year's campaign was punctuated by bitter mudslinging and a slew of fake news online - much of it directed at the presidential contenders.
"I hope after this that there will be a call for reconciliation because ... we've been living in a very polarised atmosphere," political analyst Gun Gun Heryanto told Kompas TV.