Lula da Silva's lawyers argued that he should have been allowed to stay out of jail until all appeals were heard
Lula da Silva was found guilty in August and sentenced to 10 years in prison for accepting bribes worth around a million dollars.
In January, an appeals court unanimously upheld his conviction and increased the prison sentence to 12 years.
His lawyers had argued their client had a constitutional right to stay out of jail until all appeals were exhausted. Technically that should have allowed him to stand in the presidential election in October, but now that looks highly unlikely.
José Eduardo Cardozo is a lawyer and former justice minister in Brazil. He explained the legal position to euronews:
"Under Brazilian law, there is a rule that says if someone is convicted a second time, that is to say, their conviction is upheld on appeal, as in Lula's case, then that person is barred from participating in the elections unless a higher court, exceptionally, allows him to participate.
Lula claims the charges against him are politically motivated and designed to keep him from running in October's election. He is leading in the opinion polls and commands huge support among the poorer sections of the Brazilian electorate. His Workers' Party called the ruling a "tragic day for democracy and Brazil."