0930 GMT October 17, 2021
The decision scrambles forecasts for the 2022 race, potentially paving the way for a showdown between President Jair Bolsonaro, a far-right populist, and Lula, easily his most formidable opponent on the left, according to Reuters.
Lula, as he is known throughout Brazil, governed Latin America's largest economy between 2003 and 2011. He was convicted over graft allegations in 2018 and released in late 2019.
In a surprise decision, Justice Edson Fachin ruled on Monday that a court in the southern city of Curitiba did not have the authority to try Lula on corruption charges and that he must be retried in federal courts in the capital, Brasilia.
The decision means Lula would be eligible to run for president next year should he wish to challenge Bolsonaro, said the local newspaper Folha de Sao Paulo.
Hailing the ruling in a Twitter post, Lula said it was "recognition that we have always been correct throughout our legal battle".
The office of Brazil's prosecutor general said it will appeal the decision, which will also be reviewed by the full Supreme Court.
Lula's graft conviction in 2018 blocked him from running in the elections that year. He was then released from prison in late 2019, but could not run for office due to his criminal record.
The 75-year-old has maintained his innocence and said the case against him was politically motivated.
The charismatic former union leader is a polarizing figure but still popular with many of the country's poor, who credit him for bringing millions out of poverty.
Lula is the only one of 10 potential 2022 candidates who outperformed Bolsonaro in a survey by polling company Ipec, published in newspaper O Estado de S.Paulo last week.
It found that 50 percent of the 2,002 people it interviewed "would certainly" or "could" vote for Lula, compared with 38 percent for Bolsonaro.