Polls have closed in Indonesia, following a bitter campaign in which religion has played a prominent role.
A series of “quick counts” are expected to give preliminary results within hours of the vote ending at 06:00 GMT.
The electoral commission will officially announce the victors in May.
Some 20,000 local and national seats were up for election, with the presidential race a re-match of the 2014 contest between incumbent Joko Widodo and ex-general Prabowo Subianto.
Both have made political moves in line with the increased prominence of conservative Islam in the country.
Widodo, looking to win another five-year term, is seen as the frontrunner.
Both presidential candidates cast their own votes – Mr Widodo in the capital Jakarta, and Mr Prabowo in Bogor, an hour’s drive south.
Analysts say the two main contenders have not 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.”
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.
This was the first time the country’s presidential, parliamentary and regional elections all took place on the same day. And with some 192 million people eligible to vote, that made it one of the biggest and most complex one-day polls in the world.
More than 245,000 candidates were in the running for around 20,000 national and local legislative seats.
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.
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).
Widodo, universally known by his nickname Jokowi, was first elected in 2014 when he also faced off against Prabowo, 67.
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 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. 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.
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.
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, 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 Supriatma.