A majority of Brazil's top electoral court shot down Friday the candidacy of popular leftist Luiz Inacio Lula da Silva in the country's upcoming presidential vote, telling the jailed former leader he cannot participate in October's critical election.
Lula, 72, has been incarcerated since April for accepting a bribe, but remains the top contender among Brazilians to lead Latin America's largest economy.
But barring dramatic events - the judges can reconsider their decision after the vote of the last two magistrates - the former president cannot run for a third term.
In an extraordinary session the Superior Electoral Court dashed Lula's hopes after six hours of debate, with the result coming in at 4-1 before the last two judges cast their votes - enough to seal the former president's fate.
Moments later his Workers' Party (PT) vowed to "fight with all means to secure his candidacy."
"We will present all appeals before the courts for the recognition of the rights of Lula provided by law and international treaties ratified by Brazil," said the party in a statement.
"We will defend Lula in the streets, with the people."
Lula's case was a last-minute addition to the court session, which was also to decide whether or not Lula could appear in television commercials due to begin circulating Friday.
Lula has been sentenced to 12 years in prison for accepting a luxury seaside apartment as a bribe from a construction firm.
He vehemently denies the accusations and has dismissed the charges as a political plot aimed at preventing him from standing in the elections.
The PT has stubbornly kept up its attempts to force Lula's name onto the ballot box, registering him as a candidate two weeks ago.
Lula has also received backing from the UN Human Rights Committee, which ruled that he cannot be disqualified from the elections as his legal appeals are ongoing.
The court's decision would be open to appeal, magistrate Henrique Neves, a former electoral court member, told AFP.