Brazilian President Jair Bolsonaro once said only God could remove him from power. On Sunday, polls suggest, he may need a miracle to keep him there.
A career politician turned self-styled outsider, the tough-talking Bolsonaro was elected in 2018 on vows to clean up Brazil's graft-stained politics and modernize its economy.
But after mishandling the COVID-19 pandemic and failing to lift living standards for many Brazilians, the far-right former army captain now faces the unthinkable: a possible first-round loss to his most despised rival, leftist former President Luiz Inacio Lula da Silva.
Bolsonaro has done all he can to avoid that fate. He has repeatedly - and baselessly - cast doubt on Brazil's voting system. He has changed the constitution to let him shower cash on the country's poor. And he has forged costly alliances with the centrist politicians that he and his base once maligned.
Yet so far, all has been in vain.
Lula enjoys a polling lead of around 10-15 percentage points in most surveys, with growing momentum that could see him clinch a first-round victory on Sunday, avoiding an Oct. 30 run-off.
That reflects Bolsonaro's failure to deliver on his boldest promises, as he struggled to channel the rebellious energy of four years ago into effective government, said Mauricio Santoro, a political scientist at the State University of Rio de Janeiro.
"Bolsonaro was the big new thing in 2018," said Santoro. "Now he's the establishment."
Prior to becoming president, Bolsonaro was known as a fringe conservative congressman, popular among police and soldiers in his Rio de Janeiro base.
He rode to victory in 2018 by fashioning a new conservative coalition out of agribusiness interests, free-marketeers, evangelical Christians and rank-and-file security forces. But after winning power, Bolsonaro's big tent soon began to fray, leaving him ill-equipped to handle his biggest test: the COVID-19 outbreak.
Like his political idol, former U.S. President Donald Trump, Bolsonaro underestimated the severity of the virus he referred to as a "little cold." He emphasized unproven cures like hydroxychloroquine over vaccines and showed little empathy for the nearly 700,000 Brazilians killed by the outbreak.
Many Brazilians have been unable to forgive him for that record. In particular, female voters who flocked to him in 2018 have ditched him in droves, with some experts citing his widely criticized handling of the outbreak as a key factor.
Bolsonaro has also struggled to appeal to young voters raised on stories of economic boom years under Lula, who have little memory of the corruption scandals that hurt him and his leftist successor, Dilma Rousseff.
Brazil's economy is starting to improve. Inflation has fallen from double-digit highs, while unemployment is at its lowest since 2015. But with hunger still haunting some 33 million Brazilians, Bolsonaro is not getting much credit.
Lula's economic plans are vague, but it is he who is riding high in opinion polls, while Bolsonaro faces the prospect of being Brazil's first-ever president to lose a re-election campaign.
(Reporting by Gabriel Stargardter; Additional reporting by Ricardo Brito in Brasilia; Editing by Brad Haynes and Rosalba O'Brien)