A Brazilian appeals court judge has ruled former president Luiz Inácio Lula da Silva must remain in jail, after a dizzying weekend of judicial orders and counter-orders months before the country's presidential vote.
Though he is serving a 12-year sentence for corruption, Lula, the wildly popular leftist, continues to lead opinion polls ahead of October's election and has vowed his name will be on the ballot.
In a Sunday afternoon ruling, Judge Pedro Gebran Neto overturned a surprise order to free Lula, which dropped hours earlier from Judge Rogerio Favreto at an appeals court in the southern city of Porto Alegre – the same one that had ordered the ex-president's arrest.
Favreto, the weekend duty judge, had ruled in favour of several deputies of Lula's Workers' Party (PT). On Friday they submitted a habeas corpus application on the former president's behalf, arguing he had been illegally imprisoned.
Favreto insisted his previous order stood, and ordered that Lula should be released within an hour's time.
That deadline passed, and at 6.30pm local time, Lula remained locked up. More than 1,000 supporters gathered outside his prison in Curitiba, waving banners, Brazilian flags and signs calling for his freedom.
Prosecutors in May filed new graft charges against Lula, his ex-economy minister and two other political figures allegedly promised US$40 million by the Odebrecht conglomerate, which is also linked to corruption scandals elsewhere in Latin America.
The charges are part of Operation "Car Wash," Brazil's biggest ever anti-graft crackdown. It has targeted several former presidents, current President Michel Temer and politicians from all major parties.
Investigators discovered that politicians and their parties were allegedly taking money from Odebrecht and other big companies in exchange for political favors and contracts with state oil company Petrobras.
Yet Lula and his supporters remain steadfast in their goal to take back control of Brazil's executive branch.
The former president had been writing football commentary from jail, which a veteran Brazilian sports journalist and leftist sympathiser then read on air.