Da Sila who is a former Trade Union Leader as well as a former President is now serving a 12-year prison sentence for accepting a luxury seaside apartment as a bribe from a construction firm. Under Brazilian law, Lula was deemed unable to run for the presidency after his conviction was upheld on an initial appeal.
In an extraordinary session the Superior Electoral Court dashed Mr da Silva'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 his fate.
Polls show tepid support for the vice presidential running mate Haddad's bid, but the party hopes Lula's popularity could boost the former mayor's hopes.
Top electoral court rules jailed former president can not run in October's election because of his graft conviction.
"We are not deciding at any level, on the former president's culpability, and much less his political legacy", said Judge Luis Roberto Barroso, who brought the case to the electoral tribunal for deliberation. He is the first presidential candidate to be barred from running due to the law.
"There is no margin here for the electoral court to make any other evaluation but the one showing there is a conviction, and that conviction matters in the candidate's eligibility", Barroso said. "We will defend Lula in the streets, with the people".
The widely expected decision removes a cloud hanging over Brazil's most uncertain election in decades - though Lula's lawyers have said they would appeal an adverse decision to the Supreme Court.
Many see the court decision as a marker in Brazil's fight against endemic corruption.
The lone opposing voice during the steamy session Justice Edson Fachin disagreed with his fellow justices, citing a recent call by a United Nations human rights committee calling for Lula to be allowed to run while he further appeals his conviction.
He also accused political opponents of convicting him without evidence in an attempt to take him out of the election.
The end of Lula's candidacy opens the electoral field to runner-up Jair Bolsonaro, a right-wing former soldier whose platform includes gun legalisation and weaker environmental regulations.