With every section totalled, Flavio Bolsonaro had 47.03 percent and President Lula 45.16 percent, short of a first-round majority.
Brazil's Superior Electoral Court finished totalling every polling section at 2:58 a.m. on Monday, and the presidential race is going to a second round.
Senator Flavio Bolsonaro of the Liberal Party had 56,104,503 votes, or 47.03 percent of valid votes. President Luiz Inacio Lula da Silva of the Workers' Party had 53,879,538 votes, or 45.16 percent. The gap was 2,224,965 votes.
Neither reached the majority required to win on the first ballot. The runoff is set for 25 October. Valid votes totalled 119,300,788, with turnout of 125,275,835, including 2,300,798 blank and 3,674,249 null ballots, according to the count reported by Estadao Content.
Other candidates together took 7.81 percent. Augusto Cury had 2.89 percent, Renan Santos 2.24 percent and Ronaldo Caiado 2.18 percent.
Bolsonaro, 45, is the son of former president Jair Bolsonaro. Lula is seeking another term. How the smaller candidates' voters move before 25 October was not settled in the overnight count.
