Lula’s winning margin is the closest since 1989, when Brazilians voted for a president for the first time since the end of the military dictatorship. With just a handful of votes still to be counted Lula is ahead by approximately 50.7% to 49.3%.
The previous closest margin was in 2014, when Dilma Rousseff won a second consecutive term by beating Aécio Neves by 51.6% to 48.4%.
Lula will hope that is not an omen: Dilma was impeached two years later and the convulsions that followed paved the way for the rise of the far-right.