Brazil's Workers Party has registered jailed former president Luiz Inacio Lula da Silva as its presidential candidate for October's election, even as he sat in prison serving a 12-year sentence for corruption.
About 10,000 supporters marched to the country's top electoral court in the capital Brasilia chanting "Free Lula" and "Lula for President" as they accompanied senior party members registering his candidacy hours before the deadline.
Lula, who has denied any wrongdoing, was convicted of accepting bribes and has been accused in other ongoing cases of orchestrating a kickback scheme while in office.
The former union leader has been in jail since April but leads electoral polls that include his name.
Lula is expected to be barred from running by Brazil's electoral court, but the Workers Party is expected to use an array of appeals to delay any final ruling on Lula's registration for weeks.
The Workers Party registered former Sao Paulo mayor Fernando Haddad as Lula's running mate. Haddad would top the ticket if Lula was barred, party sources said.
"People thought Lula would not survive in the polls and the opposite is the case. He is still the front-runner in all scenarios and would win outright in some of them," Haddad said after registering the party ticket.
"If the people want to vote for him they should have the right to do so."
Right-wing activist group Free Brazil Movement immediately filed a request at the TSE to invalidate Lula's candidacy because his conviction has been upheld by an appeals court, which in Brazilian law makes Lula ineligible for public office.
Lula governed Brazil for two terms from 2003 to 2010 and left office with a record approval rating of 87 per cent due to a booming economy and social programs that lifted millions of Brazilians from poverty.
That popularity has been hurt by corruption scandals involving his party, which lost power in 2016 when his hand-picked successor was impeached for breaking budget rules.
Australian Associated Press