BRASILIA (Reuters) - Lawyers for jailed former President Luiz Inacio Lula da Silva on Monday withdrew a request before Brazil's Supreme Court that he be freed because it risked shutting the door on his candidacy in the October presidential election.

Despite being jailed in April on a corruption conviction and sentenced to 12 years in prison, Lula was nominated by his Workers Party on Saturday to press its point that his conviction was political persecution aimed at stopping Brazil's most influential politician from returning to power.

The country's top electoral court is expected to invalidate his candidacy when it is registered on the Aug. 15 deadline and the party has picked former Sao Paulo mayor Fernando Haddad as running mate to stand in for Lula if needed.

Haddad said on Monday Lula had asked for the release petition to be dropped because of the risk that the top court would decide simultaneously that he was ineligible to run for office under an anti-corruption law. If the top court ruled, the electoral court would not be able to consider his case.

By registering his candidacy at the last minute next week, the former leftist leader aims to keep Brazilian's attention on his case as long as possible, helping to transfer his popular support into votes for his party.

"It was a request for his release, but it appears that the petition was going to be used to rule on his eligibility in the election," Haddad told reporters after visiting Lula in his prison in the southern city of Curitiba.

"Lula has always said he will not trade his dignity for freedom," said Haddad, who is a lawyer and was added to the former president's defence team so that he could visit Lula regularly in jail.

Lula governed Brazil for two terms from 2003-2010 and left office with a record approval rating of 87 percent thanks to a booming economy and social programs that lifted millions of Brazilians from poverty.

His popularity has been hurt by corruption indictments and scandals involving his party, which was ousted from power in 2016 when his hand-picked successor was impeached for breaking budget rules.

Still, polls show about one third of Brazilians would vote for him if he is allowed to run — almost double his nearest adversary, far-right candidate Jair Bolsonaro — and many of his supporters will vote for whomever replaces him in the race.