JAKARTA, Indonesia (AP) Tens of millions of Indonesians voted in single-day legislative elections across the vast archipelago on Wednesday, a huge feat in the young democracy that will help clear the path for the country's next president.

After three weeks of peaceful campaigning, nearly 187 million people in three time zones were eligible to cast ballots for members of national as well as local legislatures and representatives. The voting took place at more than half a million makeshift booths throughout the sprawling country, from the restive eastern province of Papua to the devout Muslim province of Aceh in the west.

For many, the poll was less about voting for an individual and more about supporting a specific party to help boost the chances for their favorite candidate in the July 9 presidential election. Parties need to secure 20 percent of the seats in the House of Representatives or 25 percent of the popular vote to put a presidential candidate forward. Otherwise, a coalition must be formed with one or more parties to enter the competition.

Many believe Jakarta Gov. Joko Widodo, known affectionately as Jokowi, is a shoo-in for the top job. The former furniture producer is a newcomer to national politics, but he is adored by legions of supporters who favor his simple style, humble background and willingness to reach out to the poor. He was topping opinion polls months before his Indonesian Democratic Party of Struggle announced in March that he would be its presidential nominee.

On Wednesday, Widodo cast his ballot alongside his wife in the sprawling capital. Both were wearing white button-down shirts, jeans and sneakers as they were thronged by a pack of around 200 journalists.

"I'm very confident that my party will do very well," Widodo said in English. "My party will win very strong, and my party will take the majority."

President Susilo Bambang Yudhoyono, who is constitutionally barred from seeking a third term, called on all candidates to respect the election results. His Democratic Party has been ensnared in a spate of high-profile corruption scandals.

"Let's honor the result of this election and be ready to accept new national leadership that will lead the nation to be better," he said after voting, urging those candidates who lose to accept it gracefully.

Three other top presidential contenders include business tycoon Aburizal Bakrie of the Golkar Party and two former generals Prabowo Subianto of the Great Indonesia Movement Party, or Gerindra, and Wiranto of the Hanura Party. Like many Indonesians, Wiranto uses one name.

Indonesia, a country of 240 million, is the world's third-largest democracy after India and the United States and the most populous Muslim nation, but there are no fundamentalist parties. The 12 main parties are either secular nationalist or moderate based loosely on Islam. A recent survey showed support for Islamic parties had plunged.

There also are no left-wing groupings, and the once-formidable Indonesian Communist Party which longtime strongman Suharto's U.S.-backed dictatorship decimated in the 1960s remains banned.

Some 200,000 candidates were vying for nearly 20,000 slots in Wednesday's elections, including 6,607 competing for the 560-seat House and 945 for regional representatives, or the Senate. The rest were competing for provincial and local councils.

The ballots were transported on everything from warships and helicopters to motorbikes and horses across the archipelago, which spans 17,000 islands. The election marks only the fourth time Indonesians have had the opportunity to pick their leaders following three decades of brutal rule that ended when Suharto was overthrown in 1998.

"There is no political figure who deserves to get my vote but Jokowi," said Titis Astrini, 29, casting her vote in Jakarta. "So for the first time, I will vote for his party." She added that in the past she had always voted for Islamic-based parties because she was impressed with their commitment to create a clean government.

"But it has been proven that religious parties can also do wrong and be involved in corruption," she said.

Many of the candidates invested their life savings for their campaigns, in some cases offering up their homes and property. Because the stakes are high for so many, some hospitals brought in extra staff and opened special rooms for treatment in case losers needed counseling for depression or stress.

Despite the excitement and energy surrounding a presidential bid by Widodo that is expected to bring out new voters, getting people to the polls remains a challenge in a country plagued by cronyism and rampant corruption that continues to blight high-ranking members of political parties. Analysts said negative comments about candidates on Twitter and Facebook discouraged some from turning out in one of the world's biggest social media-crazed countries.

Nearly 22 million Indonesians were expected to vote for the first time this year, according to the General Election Commission. An estimated half of the 53 million to 60 million young voters are considered golput, or abstainers.

Exit polls, generally considered reliable indicators of winners, were expected after voting closed Wednesday afternoon. Official results will be announced May 9.