A polarising figure

Lula, who led the country from January 2003 to December 2010, is a divisive figure.

Thousands of people took to the streets earlier this year to call for his immediate imprisonment, while his supporters also turned out in large numbers to insist he should be freed.

His jailing was controversial as defendants in Brazil were previously allowed to remain free until their final appeal had been exhausted.

However, the Supreme Court sided with a 2016 ruling from a lower court, under which defendants could be sent to jail after a failed first appeal.

Could he return as president?

Polls conducted before Lula was jailed in April suggested he was the frontrunner for October’s presidential elections.

Many political analysts say he will be disqualified from standing again because of his criminal conviction.

But this did not stop his supporters launching a campaign with an event last month.

Judge Faverto cited this as a reason for him to be released, saying it counted as a new development and all candidates should be free in order to protect “the democratic process”.

However, others disputed this, saying Lula’s intention to run was long known and nothing had changed to provoke a sudden change in his status.

Image copyrightAFP / Getty Images

Image caption
Lula’s supporters held an event in June to launch his pre-nomination campaign

The electoral court will make an official decision in August on whether Lula can run.

Why was he jailed?

In 2014, after Lula left office, prosecutors started investigating allegations that executives at the state oil company Petrobras had accepted bribes in return for awarding contracts to construction firms.

He was convicted of receiving a renovated beachfront apartment worth some 3.7m reais ($1.1m; £790,000) as a bribe by engineering firm OAS.

The defence says Lula’s ownership of the apartment has never been proven and that his conviction rests largely on the word of the former chairman of OAS, himself convicted of corruption.

Lula lost his first appeal in January, when the appeals court not only upheld his conviction but increased the sentence from nine-and-a-half years to 12.