Slideshow ( 6 images )

BRASILIA (Reuters) - The chief justice of a Brazilian appeals court blocked another judge’s efforts to release imprisoned former president Luiz Inacio Lula da Silva on Sunday, in a legal battle over the country’s most popular politician ahead of an October election.

Polls suggest the leftist icon, who is in prison for bribery, could win a third term if he entered the race, but Brazilian electoral law forbids politicians from running for office within eight years of being found guilty of a crime.

Still, an electoral court may not issue a final ruling barring Lula from the presidential contest until next month, creating a cloud of uncertainty hanging over the campaign. Sunday’s legal back-and-forth may encourage supporters holding out hope that he can still return to unite Brazil’s left.

Appeals court judge Rogerio Favreto, who served in the Justice Ministry under Lula and was appointed by his handpicked successor, ruled earlier on Sunday that the former president should have the same conditions to campaign as other candidates.

However, the chief justice of the TRF-4 appeals court, Carlos Eduardo Thompson Flores, granted a request from prosecutors to keep Lula in prison, blocking Favreto’s ruling.

The former president is serving time for taking bribes from an engineering firm in return for help landing contracts with a state firm. He faces another six trials for other corruption allegations. Lula has denied any wrongdoing.

In polling scenarios including Lula in the race, he wins more than twice the support of his nearest challenger. When he is left out, a third of respondents say they would spoil their ballots or leave them blank.

That has made it harder for leftist candidates such as former Ceara Governor Ciro Gomes to build momentum in a highly fragmented field.

Support for former Sao Paulo Mayor Fernando Haddad would more than triple with Lula’s backing, lifting him to second in the race, according to a survey last month.