With 99.8 percent of voting machines counted, left-wing challenger Luiz Inacio Lula da Silva had 48.4 percent of valid votes, compared with 43.3 percent for Bolsonaro, according to the Superior Electoral Tribunal, Al Jazeera reported.
The second-round vote will take place on October 30.
On Sunday, there were long queues at polling stations that closed at 5pm local time (20:00 GMT).
About 156 million people were eligible to vote.
ZZ/PR