The decision means thousands of convicts could be released from prison, including Lula, who is among dozens of political and businessa leaders caught up in a sprawling corruption probe.
These include Lula, as he still has appeals out against his conviction.
His lawyers are expected to swiftly file for his release at the lower court that convicted him. "Lula has not done anything wrong and is a victim of 'lawfare, ' which in the case of the ex-president is the strategic use of the law for the objective of political persecution", his legal team said in a statement.
With a vote of 6 to 5, the court revoked a three-year rule that contributed to the success of Brazil's largest corruption investigation, the so-called auto wash operation that put dozens of company executives and politicians in jail for bribes and bribes.
The Car Wash prosecutors said the ruling would make their job harder and favor impunity because of Brazil's "excessive" appeal processes.
Gleisi Hoffman, the leader of Lula's Worker's Party, called Thursday's development "a very important step to strengthen democracy and the constitution at a time when they are under threat from an extreme-right government". In recent days, scores of politicians have lobbied Supreme Court President Jose Antonio Dias Toffoli, who cast the deciding vote, to maintain the ruling. Judges are debating whether a defendant is to begin serving his sentence after a conviction has been reached by the first appellate court, which could affect cases like that of Da Silva. But fellow judge Marco Aurelio Mello warned of the risk for judicial errors. "We will continue to fight for justice".
Lula was jailed in 2018 after being sentenced to more than 12 years in prison, later reduced to eight years and 10 months, for receiving a beachside apartment from an engineering company implicated in the Car Wash investigation.
Dozens of people yelling "good morning, Lula" and waving "Free Lula" signs stood outside the federal police headquarters in the southern city of Curitiba on Friday where the former president has been held since April 2018.
Lula has consistently denied all the accusations against him and claims they are politically motivated. Lula had been favorite to win the 2018 election but his imprisonment barred him from running.
Almost 5,000 convicts could potentially benefit from the ruling that has been criticised by the country's justice minister.
Lula's release would heighten tensions in a polarized nation that elected far-right President Jair Bolsonaro a year ago.