The most voted candidate was the leftist Lula da Silva, from the Workers' Party, with 48% of the vote, compared to 44% for the current president, Jair Bolsonaro, from the Liberal Party.
The two candidates will meet in a second round to decide the presidency.
The vote for territories
The map below shows the most voted candidate in each of the more than 5,700 Brazilian municipalities.
Finally, two maps are shown with the territorial distribution of the vote of the two main candidates, Lula and Bolsonaro.
our map
And now that?
As no candidate has achieved an absolute majority of votes in this first ballot, a second round will be held on October 30.
Voters will then have to choose between the two most voted candidates this Sunday, Lula da Silva and Jair Bolsonaro.