Tens of millions of Indonesians have started voting for a new president and more than 20,000 legislative seats in the nation’s biggest – and one of the world’s most complicated – ballots.

In the world’s third-largest democracy and largest Muslim-majority nation, almost 193 million Indonesians are registered to vote across 17,000 islands. On Wednesday morning voting kicked off at 7am local time in restive Papua. It will end at 1pm in Sumatra.

Voters are flocking to more than 800,000 polling stations where they will punch holes in ballots – to make clear their candidate choice – and then dip a finger in halal ink, a measure to prevent double-voting.

It is the first time Indonesia is holding simultaneous presidential and parliamentary elections – a hugely complex logistical undertaking – but it is the presidential race that has consumed much of the nation’s focus.

President Joko “Jokowi” Widodo, a former mayor and furniture salesman from central Java, is up against the fiery nationalist and former army general Prabowo Subianto.

Prabowo, the former son-in-law of Indonesia’s longtime ruler Suharto, is running with Sandiaga Uno, a former private equity manager, while the president controversially chose Ma’ruf Amin, 76, a conservative Islamic leader, as his vice-presidential running mate.

Indonesian election workers carry ballot boxes as they cross a river to deliver them to remote villages in Maros, South Sulawesi. Photograph: Daeng Mansur/EPA

In an election campaign that has been marred by fake news, identity politics and attempts by the candidates to outdo each other in displays of religiosity, Jokowi has for months maintained a double-digit lead over his opponent – if the the country’s most credible polls are to be believed.

“I’m excited, we only get to do this once every five years,” said Neneng Kursiah, 37, after completing her ballot at a Jakarta polling booth.

“We are for Prabowo in this area, we think he will bring prices of staple foods down and work hard,” said Firman, 42, a voter in Jakarta’s south, chimed in, “But if people want to vote for someone else that’s okay too.”

“Should be tight, maybe 50-50 said Bambang Sukanto, a local council worker at a different voting station, “So we are going to watch and make see.”

Contemplating whether one of the only true remaining democracies in south-east Asia could be prone to a political upset akin to Brexit, Trump or Duterte, analysts predict Indonesia is likely to buck global trends.

“I think Indonesia was ahead of the curve in that aspect of democracy because the anti-establishment outsider, Joko Widodo, won in 2014 already,” says an Indonesia analyst, Kevin O’Rourke. “Ironically, the incumbent is the outsider in this race, meanwhile Prabowo Subianto is not the outsider, or anti-establishment figure, he is a quintessential member of the elite.”

Jokowi’s 2014 win against Prabowo was hailed as a victory for Indonesia’s young democracy – the first time a figure untethered to the military or political elite had been elected head of state.

As president, Jokowi has impressed voters with his commitment to building infrastructure and social welfare, but has drawn criticism for failing to address past human rights abuses and chronic corruption, and most recently for leveraging the state apparatus, including law enforcement agencies and Islamic groups, to solidify his support base.

Ayu Dyah Widarti, a volunteer for Jokowi, has spent her morning riding around on her bicycle, checking on the voting process at various polls in Jakarta’s south.

“People are enthusiastic, smiling, and it’s been smooth,” she says.

Ayu says she is strong supporter of the incumbent. “He has a vision, he in sincere, he works hard, hard, hard. He has high integrity and is honest. And he doesn’t have a problematic background, or any baggage,” she says,

“There is already evidence of his leadership, from when he was Solo mayor, Jakarta governor and also a president. He has built a lot of infrastructure and not just for Jakarta, but all over Indonesia, for all Indonesians.”

Some voters, disillusioned with the president and also the alternative, a former special forces commander accused of various human rights abuses, have vowed to “golput”, or abstain, in protest.

In the weeks leading up to Wednesday’s vote, the opposition has claimed the integrity of the electoral list is undermined by the existence of millions of “ghost” voters – a move some analysts believe indicates they are laying the groundwork for a legal challenge if they lose.

There have been other hiccups, too. A video that circulated last week allegedly showed bags of ballot papers found in Malaysia that were pre-marked for Jokowi. There is also concern about rampant vote buying and the inundation of overseas polling stations in recent days, which have reportedly prevented hundreds from voting, have generated concern.

Indonesia’s electoral commission has pledged to investigate, and Wednesday’s election, a government-mandated national holiday, is expected to proceed peacefully and under the watchful eye of voters, thousands of whom plan to monitor the open-air count after the polls close.

The polls present a huge logistical challenge in a country stretching 4,800km across more than 17,000 islands, with a population of more than 260 million, home to hundreds of ethnic groups and languages.

Officials are moving cardboard ballot boxes by motorbikes, boats and planes – as well as elephants and horses – to reach mountaintop villages and communities deep in the jungle.

A series of so-called “quick counts” are expected to give a reliable indication of the presidential winner later on Wednesday. Official results are not expected until May.