Former Brazilian President Luís Inácio Lula da Silva was released after more than 18 months in prison.
The former leftist leader, known as Lula, was greeted with enthusiastic applause from the crowd of his supporters as he was coming out of prison on Friday.
He was incarcerated in a prison in the city of Curitiba for corruption.
A judge ordered his release following a Supreme Court ruling that the defendants should only be imprisoned when they exhausted their appeals.
- A quick guide to the scandals of Brazil
The 74-year-old former president, who headed Brazil between 2003 and 2010, is considered an icon of the left in the country. When he left the prison, he raised his fist in the air as a sign of victory.
"I did not think that today I could be here to talk to men and women who shouted hello, good morning or goodnight for 580 days, that it was raining or that it was raining. it's 40 degrees Celsius, "he told the crowd.
He also promised to prove his innocence before taking on the "rotten side of the justice system", which he accused of "working to criminalize the left".
Lula was the favorite to win the presidential election last year but was jailed after being involved in a major corruption scandal. The race was won by the far right candidate, Jair Bolsonaro.
In criticizing Bolsonaro's economic policy, Lula vowed to continue fighting for impoverished Brazilians.
"People are more hungry, they do not have jobs, people work for Uber or deliver pizzas by bike," he added, particularly criticizing the precarious work and the lack of work. economy of the show.
After Lula's release, President Bolsonaro said the ex-president was "momentarily free, but guilty".
He asked his followers on Twitter "not to give ammunition to the scoundrel".
Lula will be prevented from running for office because of his criminal record.
He has always denied all the accusations against him and claims to have a political motivation.
"Our legal battle continues, our goal is to secure the nullity of the trial," said his lawyer Cristiano Zanin.
A politician who arouses emotions
For supporters of Lula, this sounds like a justification – it's a politician who arouses emotions and those who support him believe that it's a political witch hunt since the very early.
There is no guarantee that Lula will remain free forever – he may not win the remaining appeals – and he has also been charged with corruption in other cases for which he will face justice.
But now that Lula is free, it will strengthen the left in Brazil and strengthen the right. President Bolsonaro does not hide his disdain for Lula and millions of people agree that it is anger with regard to Lula and the Workers Party that pushed Mr. Bolsonaro to take power.
Why was Lula released?
The judges decided to reinterpret the country's penal code in a decision made on Thursday.
It overturns a three-year-old rule that provided for an immediate prison sentence for convicted criminals after the loss of their first appeal.
The bribery scandal in Brazil, known as Operation Car Wash, originally concerned the state-owned oil company Petrobras, but billions of dollars in bribes were later discovered – and dozens of business leaders and top politicians have been jailed.
The rule of mandatory imprisonment was seen as helping prosecutors convict and dispel the scandal by encouraging suspects to negotiate plea agreements.
Detractors have claimed that this violates Brazil's constitution, which states that no one may be deprived of their liberty without due process.
Lula was jailed in 2018 after being sentenced to more than 12 years in jail, then reduced to eight years and 10 months in jail for receiving a beachfront apartment from a corporation. Engineering involved in the Car Wash investigation.
Earlier this year, he was sentenced to 12 more years after being found guilty of accepting bribes in the form of renovations to a construction company's country house.