About 190 million registered voters have begun casting ballots for the president of Indonesia, the world's third largest democracy.
They are choosing between Joko Widodo, the governor of Jakarta, and Prabowo Subianto, an ex-army general.Opinion polls so far have suggested that it will be a very tight race.
Mr Widodo, also known as Jokowi, appeared to be leading in opinion polls early on, but that margin narrowed as Mr Subianto gained ground.
The first polls opened at 07:00 local time on Friday (22:00 GMT on Thursday) in the east of the country. Jakarta and the island of Java began voting two hours later at 07:00 in their time zone (0000 GMT).
In recent weeks media outlets have been accused of favouring particular candidates, prompting outgoing President Susilo Bambang Yudhoyono to call for more balanced coverage.
Mr Yudhoyono cannot stand for another term as the constitution has a two-term limit.
Commentators say undecided voters will have a significant impact on results. About one-fifth of Indonesians fell into this category in the late June surveys.
Source: BBC