Flávio Bolsonaro took 56.1m votes to Lula's 53.8m in Brazil's first round, setting up a 25 October runoff that Luiz Inácio Lula da Silva must overturn.
A false claim about Brazil's patron saint drew contradictory Supreme Court rulings and a dispute with the bishops' conference in the final week of the campaign.