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.
Read analysis from RNZ's Foreign News Editor Graeme Acton:
A BBC poll, conducted by Kompas, puts Mr Widodo's share of the sample ballot counted so far at 54 percent, while his rival had 45 percent. 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".
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 7am local time. 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 - 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.
Even before voting began, however, 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, 57, comes from humble beginnings - he is a former furniture salesman - and has focused past campaigns around his "man of the people" image. He is universally known by his nickname Jokowi, and was first elected in 2014 when he also faced off against Mr Prabowo, 67.
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 General Suharto, who ruled Indonesia with an iron fist for 30 years. Mr Prabowo stands accused of complicity in human rights abuses committed under General 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 percent 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", said Mr Supriatma.