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".
In a Jakarta neighbourhood I met Wina. She tells me she wants a better future for her children, + religion has been blown out of proportion in this election. “I’m Muslim, but it doesn’t matter to me if my leader is. I want someone who is honest and cares about the unity of 🇮🇩” pic.twitter.com/m196osPjf4— Karishma Vaswani (@BBCKarishma) April 17, 2019
Muslim-majority Indonesia is made up of thousands of islands and has more than 260 million people. It is home to the world's largest Muslim population.
Why is this election unique?
This was the first time the country's presidential, parliamentary and regional elections all took place on the same day, with more than 245,000 candidates in the running for various seats.
If that was not hard enough to co-ordinate, things were further complicated by the geography of Indonesia - an archipelago of more than 17,000 islands.
Polling stations opened in eastern Indonesia at 07:00 local time (22:00 GMT Tuesday). The country has three time zones, and western Indonesia, including the capital Jakarta, began voting from midnight GMT.
Voters - including those in remote and far-flung parts of the vast country - had a window of only six hours to cast their ballots at one of the country's 810,000 polling stations. However, officials were expected to allow anyone already in line when stations closed to cast their ballots.
But even before voting began, the poll was hit with claims of vote-rigging. Indonesia launched an investigation last week after videos emerged appearing to show thousands of stray ballot papers at a warehouse in neighbouring Malaysia - many of them allegedly marked in favour of President Widodo. Close to a million overseas Indonesian voters are believed to live in Malaysia.
Who are the contenders?
The presidential election pits Joko Widodo of the Indonesian Democratic Party of Struggle (PDI-P) against his long-time rival Prabowo Subianto, of the Great Indonesia Movement Party (Gerindra).
Mr Widodo, universally known by his nickname Jokowi, was first elected in 2014 when he also faced off against Mr Prabowo, 67.
Mr Widodo, 57, comes from humble beginnings - he is a former furniture salesman - and has focused past campaigns around his "man of the people" image.
Under his leadership the economy has grown steadily, but he has disappointed some supporters by abandoning campaign promises to resolve human rights violations. He has courted massive Chinese infrastructure investment.
Meanwhile Mr Prabowo is closely associated with the traditional political elite.
He was previously married to the daughter of former dictator Gen Suharto, who ruled Indonesia with an iron fist for 30 years. Mr Prabowo stands accused of complicity in human rights abuses committed under Gen Suharto, but has maintained his innocence.
Despite his background, during the campaign he has sought to distance himself from the political class and railed against the "evil elites in Jakarta".
He has promised to review all Chinese projects in Indonesia if he becomes president.
What are the main issues?
As ever, infrastructure, corruption and the economy are all on voters' minds. But one of the most important issues is Indonesia's national identity.
Though 80% of the country is Muslim, Indonesia has no official state religion and the right to practise other faiths is enshrined in the constitution.
But in recent years, Indonesia has seen conservative religious groups grow increasingly vocal.
This came to the fore in 2016 when hardliners accused Jakarta's Chinese-Christian governor Basuki Tjahaja Purnama - known as Ahok - of blasphemy against Islam.
After mass rallies in the streets, he was imprisoned for two years.
Analysts say the presidential candidates have taken note of this shift, and sought to tout their Islamic credentials.
Mr Widodo, a religious moderate, has picked powerful cleric Ma'ruf Amin as his running mate. The cleric is one of the most influential Muslim figures in Indonesia and used to head the country's largest Islamic organisation.
Meanwhile, Mr Prabowo has promised to protect Islamic leaders and increase funding for religious schools.
These elections "will pretty much define the role of Islam in Indonesia", says Mr Supriatma.