Indonesia's president looks to be on course for re-election, according to unofficial results released within hours of polls closing.
Joko Widodo is about 10 percentage points ahead of his rival, ex-general Prabowo Subianto.
Official results are not expected until May, but the so-called "quick counts" - undertaken by polling companies - have proved correct in previous years.
Indonesia voted on Wednesday in one of the world's largest one-day elections.
More than 192 million people were eligible to cast their ballot to select 20,000 local and national lawmakers, including the president.
Mr Widodo called for patience when he addressed his supporters.
"We have seen the results of the quick count and exit poll but we need to be patient, be patient to wait for the official result from the election commission," he said.
Mr Prabowo, however, disputed the figures and said his team's own data suggested he was in the lead. He urged supporters to be vigilant against any attempts to steal the election.
The presidential race was a re-match of the 2014 contest between Mr Widodo and Mr Prabowo, who both made political moves in line with the increased prominence of conservative Islam in the country.
A BBC poll, conducted by Kompas, puts Mr Widodo's share of the sample ballot counted so far at 54%, while his rival has 45%. A number of other private polling companies are reporting similar outcomes.
According to analysts, neither of the candidates presented wildly different policy platforms, apart from their views on Chinese investment.
"Therefore, the only contrast they can draw is by showing their religious credentials," said Made Supriatma, a visiting fellow and Indonesia expert at the ISEAS-Yusof Ishak Institute in Singapore.
"This election is a 'race to the right'... a race to show who is more Islamic conservative."
One Muslim voter told the BBC that "religion has been blown out of proportion in this election".