A Brazilian Supreme Court judge has annulled the criminal convictions against former leftist president Luiz Inacio Lula da Silva, a move that could allow the popular politician to run in next year's presidential election.

The decision roiled financial markets and scrambled forecasts for the 2022 race, with many investors betting it would polarise voters between President Jair Bolsonaro, a far-right populist, and Mr Lula, his greatest opponent on the left.

In a surprise decision, Justice Edson Fachin said a court in the southern city of Curitiba had lacked the authority to try Mr Lula on corruption charges and that he must be retried in federal courts in the capital Brasilia.

President Bolsonaro, speaking to reporters in Brasilia, said he hoped the decision is overturned when it is reviewed by the full Supreme Court. He added that he did not believe Brazilians wanted Mr Lula to run next year.

The office of Brazil's prosecutor general said it will appeal the decision.

Brazil's real sank around 1.5% to a fresh four-month low after the news and the Bovespa stock index fell 4%. The real closed at 5.7779 per dollar, its weakest since May last year.

Financial analysts said the prospect of Mr Lula candidacy would likely drive President Bolsonaro to abandon economic reforms he ran on in 2018 and further embrace populist measures to shore up support.

"With Lula eligible, the chance of this current government going totally towards populism increases even more," said Alfredo Menezes, managing partner at Armor Capital.

President Jair Bolsonaro

Mr Lula, 75, governed Latin America's biggest country and largest economy between 2003 and 2011, overseeing a commodities boom that turbocharged economic growth.

In 2018, he was convicted of taking bribes from engineering firms in return for public contracts and spent a year and a half behind bars, until the Supreme Court ruled he and others could appeal their cases without serving time.

Mr Lula and his supporters blasted the anti-corruption taskforce that brought him down, called Operation Car Wash, as a politically driven effort. Leaked conversations in 2019 raised questions about whether investigators had cut corners to secure prosecutions. The task force was disbanded in February.

In a note, Mr Lula's legal team said the decision was recognition that the former president was innocent.

His conviction had prevented him from running for another presidential term in 2018.

The charismatic former union leader is a polarising figure but still beloved by much of Brazil's working class for bringing millions out of poverty through generous social welfare programmes.

Mr Lula is the only one of 10 potential 2022 candidates who outperformed the president in a survey by polling company Ipec, published in newspaper O Estado de S.Paulo last week.

It found that 50% of the 2,002 people it interviewed "would certainly" or "could" vote for Mr Lula, compared with 38% for Mr Bolsonaro.

Some 44% of respondents said they would never vote for Mr Lula, while 56% would never vote for Bolsonaro, the poll found.