Indonesian President Joko Widodo appeared set for a second term as "quick count" results from Wednesday's election rolled in, but his challenger claimed that he had won the popular vote and urged supporters not to let his victory be snatched away.
Data from private pollsters based on counts of vote samples were in line with opinion polls that had predicted a win for Mr. Widodo, a former furniture businessman and low-key reformist.
They showed him winning the popular vote with about 54%, with a lead of between 7.1 and 11.6 percentage points over former general Prabowo Subianto, who was narrowly defeated when he took Mr. Widodo on in the last election five years ago.
Mr. Prabowo, a former son-in-law of military strongman Suharto who was overthrown in 1998, told a news conference that – based on internal exit polls and "quick count" numbers – his campaign believed his share of the vote was in a 52-54 percent range.
"We have noted several incidents that have harmed the supporters of this ticket," he said, without giving detail. "Our volunteers should focus on safeguarding the ballot boxes because they are key to our victory."
Mr. Widodo said the results indicated he had regained the presidency of the world's fourth-most-populous nation, but urged supporters to wait for the election commission to announce official results.
Kevin O’Rourke, a political analyst and author of the Indonesia-focused newsletter Reformasi Weekly, said that Mr. Widodo's re-election was now clear but his victory over Mr. Prabowo was not resounding.
"He failed to attain the psychological 60% level that had seemed within reach," Mr. O'Rourke said. "Prabowo performed better than expected, which may embolden him to run yet again in 2024, if he is sufficiently fit."
Mr. Widodo grew up in a riverside slum and was the first national leader to come from outside the political and military elite. Popularly known as Jokowi, his everyman image resonated in 2014 with voters tired of the old guard.
The eight-hour vote on Wednesday for both the presidency and legislature seats across a country that stretches more than 3,000 miles from its western to eastern tips was both a Herculean logistical feat and testimony to the resilience of democracy two decades after authoritarianism was defeated.
The poll followed a campaign dominated by economic issues but was also marked by the growing influence of conservative Islam in the world's biggest Muslim-majority nation.
A senior government official close to the president said before the election that a win for Mr. Widodo with 52-55% of the vote would be a "sweet spot," and enough of a mandate to press on with, and even accelerate, reforms.
The official election results will not be published until May. Any disputes can be taken to the Constitutional Court where a nine-judge panel will have 14 days to rule on them.
More than 10,000 volunteers crowd-sourced results posted at polling stations in a real-time bid to thwart attempts at fraud.
However, even before the election, the opposition alleged voter-list irregularities that it said could affect millions and vowed legal or "people power" action if its concerns were ignored.
Ferdinand Hutahaen, a spokesman for the Prabowo campaign, sought to soothe concerns this could mean a violent response.
"Don't consider 'people power' as a form of violence," he told reporters. "There will be no burning, killing. We will see what kind of 'people power' and revolution society wants. We don't want conflict in this country."
Mr. Widodo campaigned on his record of deregulation and improving infrastructure, calling his first term a step to tackling inequality and poverty in Southeast Asia's biggest economy.
But religion has also been a factor. Conservative Muslim groups have been increasingly influential.
Mr. Widodo, a moderate Muslim from Java island, had to burnish his Islamic credentials after smear campaigns and hoax stories accused him of being anti-Islam, a communist, or too close to China, all politically damaging in Indonesia. He picked Islamic cleric Ma'ruf Amin as his running mate.
Mr. Prabowo, a former special forces commander who has links to some hardline Muslim groups, and his running mate, business entrepreneur Sandiaga Uno, pledged to boost the economy by slashing taxes and cutting food prices.
This story was reported by the Thomas Reuters Foundation. Agustinus Beo da Costa, Maikel Jefriando, Tabita Diela, Kanupriya Kapoor, Jessica Damiana, Cindy Silviana, Tommy Ardiansyah and Mas Alina Arifin contributed.