BrasíliaFlávio Bolsonaro beat Lula 47% to 45.1%.
Polls had Lula ahead by 3 points before Brazil voted.
Lula lost ground on crime and on interest rates that punish the 82% of families carrying debt, analysts say.
The runoff is 25 October, and Bolsonaro has pledged to seek amnesty for his jailed father.
Sources: Financial Times News, RT, Al Jazeera Online