Indonesian voters deciding between moderate and ex-general

A woman shows her inked finger after casting her ballot at a polling station during the election in Jakarta, Indonesia, Wednesday, April 17, 2019. Vot

A woman shows her inked finger after casting her ballot at a polling station during the election in Jakarta, Indonesia, Wednesday, April 17, 2019. Vot

A woman casts her vote during presidential and legislative elections at a polling station in Bali, Indonesia on Wednesday, April 17, 2019. Voting is u

A woman casts her vote during presidential and legislative elections at a polling station in Bali, Indonesia on Wednesday, April 17, 2019. Voting is u

A Muslim woman casts her ballot during the election at a polling station in Jakarta, Indonesia, Wednesday, April 17, 2019. Voting is underway in Indon

A Muslim woman casts her ballot during the election at a polling station in Jakarta, Indonesia, Wednesday, April 17, 2019. Voting is underway in Indon

An electoral worker inspects a presidential ballot during the election at a polling station in Jakarta, Indonesia, Wednesday, April 17, 2019. Voting i

An electoral worker inspects a presidential ballot during the election at a polling station in Jakarta, Indonesia, Wednesday, April 17, 2019. Voting i

An Indonesian woman casts her vote during presidential and legislative elections at a polling station in Bali, Indonesia Wednesday, April 17, 2019. Vo

An Indonesian woman casts her vote during presidential and legislative elections at a polling station in Bali, Indonesia Wednesday, April 17, 2019. Vo

Indonesians queue up to cast their votes during the election near a railway track at a slum in Jakarta, Indonesia, Wednesday, April 17, 2019. Voting i

Indonesians queue up to cast their votes during the election near a railway track at a slum in Jakarta, Indonesia, Wednesday, April 17, 2019. Voting i

A Muslim woman casts her ballot during the election at a polling station in Jakarta, Indonesia, Wednesday, April 17, 2019. Voting is underway in Indon

A Muslim woman casts her ballot during the election at a polling station in Jakarta, Indonesia, Wednesday, April 17, 2019. Voting is underway in Indon

An electoral worker shows a legislative ballot to a voter during the election at a polling station in Jakarta, Indonesia, Wednesday, April 17, 2019. V

An electoral worker shows a legislative ballot to a voter during the election at a polling station in Jakarta, Indonesia, Wednesday, April 17, 2019. V

A woman casts her ballot at a polling station during the election in Jakarta, Indonesia, Wednesday, April 17, 2019. The Indonesian presidential electi

A woman casts her ballot at a polling station during the election in Jakarta, Indonesia, Wednesday, April 17, 2019. The Indonesian presidential electi

Indonesian President Joko "Jokowi" Widodo and his wife Iriana cast their ballots during the election at a polling station in Jakarta, Indonesia, Wedne

Indonesian President Joko "Jokowi" Widodo and his wife Iriana cast their ballots during the election at a polling station in Jakarta, Indonesia, Wedne

Indonesian President Joko "Jokowi" Widodo and his wife Iriana cast their ballots during the election at a polling station in Jakarta, Indonesia, Wedne

Indonesian President Joko "Jokowi" Widodo and his wife Iriana cast their ballots during the election at a polling station in Jakarta, Indonesia, Wedne

Indonesian President Joko "Jokowi" Widodo shows his inked finger as his wife Iriana looks on after casting their ballots during the election at a poll

Indonesian President Joko "Jokowi" Widodo shows his inked finger as his wife Iriana looks on after casting their ballots during the election at a poll

Indonesian presidential candidate Prabowo Subianto greets to his supporters after casting his vote at a polling station in Bogor, Indonesia, Wednesday

Indonesian presidential candidate Prabowo Subianto greets to his supporters after casting his vote at a polling station in Bogor, Indonesia, Wednesday

Indonesian presidential candidate Prabowo Subianto greets to his supporters after casting his vote at a polling station in Bogor, Indonesia, Wednesday

Indonesian presidential candidate Prabowo Subianto greets to his supporters after casting his vote at a polling station in Bogor, Indonesia, Wednesday

JAKARTA, Indonesia (AP) — Tens of millions of Indonesians were voting in presidential and legislative elections Wednesday after a campaign that pitted the moderate incumbent against an ultranationalist former general whose fear-based rhetoric warned the country would fall apart without his strongman leadership.

The first votes were cast in easternmost provinces after polling booths opened at 7 a.m., followed an hour later by central regions such as Bali and then the capital Jakarta and western provinces. Indonesia, a sprawling archipelago of 17,000 islands and hundreds of ethnic groups, has three time zones.

About 193 million people are eligible to vote in polls that will decide who leads the world's most populous Muslim-majority nation and third-largest democracy after India and the U.S. Indonesians are also voting for Senate and national, provincial and district legislatures.

The elections are a huge logistical exercise with more than 800,000 polling stations and 17 million people involved in ensuring they run smoothly. Helicopters, boats and horses are used to get ballots to remote and inaccessible corners of the archipelago.

The presidential race is a choice between five more years of the steady progress achieved under Indonesia's first president from outside the Jakarta elite, Joko "Jokowi" Widodo, or electing Prabowo Subianto, who was a special forces general during the era of the Suharto military dictatorship.

Opinion polls have consistently given a large lead of as much as 20 percentage points to Widodo and his running mate, conservative cleric Ma'ruf Amin, though analysts say the race is likely tighter.

"I've voted for Jokowi because five years in office was not enough for him to complete his brilliant programs for infrastructure, health and education," said Eko Cahya Pratama, 43, after voting in Tangerang on the outskirts of Jakarta.

"For me, this country is better to be managed by a man with a clean track record rather than a dirty one in the past," he said.

Widodo's campaign highlighted his progress in poverty reduction and improving Indonesia's inadequate infrastructure with new ports, toll roads, airports and mass rapid transit. The latter became a reality last month in Jakarta, the country's chronically congested capital, with the opening of a subway.

A strident nationalist, Subianto has run a fear-based campaign, highlighting what he sees as Indonesia's weakness and the risk of exploitation by foreign powers or disintegration.

"He deserves to get my vote because I was impressed with his commitment to create a clean government and a great nation," said Anneka Karoine, 43, after she and her husband voted for Subianto and his running mate, tycoon Sandiaga Uno. "I believe they will lead our country better than the current leader."

Voting ends at 1 p.m. and so-called "quick count" results are expected after about two hours.

Subianto voted not long after 8 a.m. in Bogor in West Java province, which is one of his strongholds of support, and told reporters he was confident of winning despite trailing in the polls.

"I promised that we will work for the good of the country," he said. "If it's chaos or not, it's not coming from us. But I guarantee that we don't want to be cheated anymore, that Indonesian people don't want to be cheated anymore."

Widodo, who voted in Jakarta, held up a finger dipped in inedible ink to show reporters and said his next stop was playing with his grandson and eating with his wife Iriana Widodo.

Asked if he was feeling optimistic about the results of Wednesday's vote, Widodo said: "Always. We should stay optimistic at work."