Bolsanaro has attacked the voting system and threatened to contest defeat.
Brazil's top election candidates cast their votes
STORY: Former Brazilian President Luiz Inacio Lula da Silva held a solid polling lead over incumbent President Jair Bolsonaro going into the vote.