Lula received 51.76% of the vote after a near-complete count of ballots, compared to 48.24% for the son of former President Jair Bolsonaro, according to official results.