Former Brazilian president Luiz Inacio Lula da Silva has been released from prison.

Hundreds of supporters greeted the politician outside the facility in the southern city of Curitiba on Friday after the South American country’s Supreme Court ruled a person can be imprisoned only after all the appeals have been exhausted.

The 74-year-old is appealing his conviction of corruption and money laundering in connection with the purchase of a beachfront apartment in Sao Paulo state.

A stage was set up for him to address the crowd.

Mr Da Silva, who is universally known as Lula, tweeted “Lula Free” with a video of himself working out and lifting weights in a gym inside the prison, where he has been detained since April 2018. Still, he could find himself back in prison if his appeals don't go his way.

Jair Bolsonaro: Brazil's far-right leader inauguration Show all 20 1 /20 Jair Bolsonaro: Brazil's far-right leader inauguration Jair Bolsonaro: Brazil's far-right leader inauguration Brazil's new President Jair Bolsonaro waves as he drives past before his swear-in ceremony Reuters Jair Bolsonaro: Brazil's far-right leader inauguration Supporters wait in front of the Planalto Palace, where he will take office EPA Jair Bolsonaro: Brazil's far-right leader inauguration Jair Bolsonaro gestures at the Congress before he is sworn AFP/Getty Jair Bolsonaro: Brazil's far-right leader inauguration Supporters take pictures as Brazil's new President Jair Bolsonaro drives past Reuters Jair Bolsonaro: Brazil's far-right leader inauguration Flanked by first lady Michelle Bolsonaro, Brazil's President Jair Bolsonaro waves to the crowd, as he rides in an open car after his swearing-in ceremony AP Jair Bolsonaro: Brazil's far-right leader inauguration Jair Bolsonaro reacts as he drives past Reuters Jair Bolsonaro: Brazil's far-right leader inauguration Brazil's new President Jair Bolsonaro reacts as he drives past before his swear-in ceremony, in Brasilia, Brazil January 1, 2019. REUTERS/Ricardo Moraes RICARDO MORAES Reuters Jair Bolsonaro: Brazil's far-right leader inauguration The National Congress before Brazil's President-elect Jair Bolsonaro is sworn in AFP/Getty Jair Bolsonaro: Brazil's far-right leader inauguration Jair Bolsonaro gestures at the Congress AFP/Getty Jair Bolsonaro: Brazil's far-right leader inauguration Brazil's new President Jair Bolsonaro waves as he drives past before his swear-in ceremony, in Brasilia, Brazil January 1, 2019. REUTERS/Ricardo Moraes RICARDO MORAES Reuters Jair Bolsonaro: Brazil's far-right leader inauguration Supporters of Brazil's President Elect Jair Bolsonaro are cooled down with a water hose by firefighters, prior Bolsonaro's inauguration, in Brasilia, Brazil, Tuesday Jan. 1, 2019. (AP Photo/Silvia Izquierdo) Silvia Izquierdo AP Jair Bolsonaro: Brazil's far-right leader inauguration The presidential convoy, led by Brazil's President-elect Jair Bolsonaro (L) and his wife Michelle Bolsonaro in a Rolls Royce, heads to the National Congress for his swearing-in ceremony, in Brasilia on January 1, 2019. - Bolsonaro takes office with promises to radically change the path taken by Latin America's biggest country by trashing decades of centre-left policies. (Photo by Carl DE SOUZA / AFP)CARL DE SOUZA/AFP/Getty Images CARL DE SOUZA AFP/Getty Jair Bolsonaro: Brazil's far-right leader inauguration epa07257163 Sympathizers of Brazilian President-elect, Jair Bolsonaro, walk past a giant figure of the future president before the beginning of the inauguration ceremony, in Brasilia, Brazil, 01 January 2019. A far-right president leads the biggest Latin America democracy for first time since the end of military rule (1964-1985). Bolsonaro defeated candidate Fernando Haddad in the runoff, held in October 2018, receiving 55 percent of the vote. EPA/Fernando Bizerra Jr Fernando Bizerra Jr EPA Jair Bolsonaro: Brazil's far-right leader inauguration Brazil's President-elect Jair Bolsonaro (L) gestures next to his wife Michelle Bolsonaro as the presidential convoy heads to the National Congress for his swearing-in ceremony, in Brasilia on January 1, 2019. - Bolsonaro takes office with promises to radically change the path taken by Latin America's biggest country by trashing decades of centre-left policies. (Photo by Carl DE SOUZA / AFP)CARL DE SOUZA/AFP/Getty Images CARL DE SOUZA AFP/Getty Jair Bolsonaro: Brazil's far-right leader inauguration Firefighters spray water at supporters of Brazilian President-elect Jair Bolsonaro to cool them down, while they gather to wait for his inauguration ceremony at "Tres Poderes" square in front of the Planalto Palace in Brasilia, on January 01, 2019. - Brazil entered a new chapter in its history on Tuesday, embracing a far-right president, Jair Bolsonaro, whose determination to break with decades of centrist rule has raised both hopes and fears. (Photo by EVARISTO SA / AFP)EVARISTO SA/AFP/Getty Images EVARISTO SA AFP/Getty Jair Bolsonaro: Brazil's far-right leader inauguration Supporters take pictures as Brazil's new President Jair Bolsonaro drives past before his swear-in ceremony, in Brasilia, Brazil January 1, 2019. REUTERS/Ricardo Moraes RICARDO MORAES Reuters Jair Bolsonaro: Brazil's far-right leader inauguration Brazil's new President Jair Bolsonaro and his wife, Michelle Bolsonaro, arrive at Brazil's National Congress, in Brasilia, Brazil January 1, 2019. REUTERS/Pilar Olivares PILAR OLIVARES Reuters Jair Bolsonaro: Brazil's far-right leader inauguration Supporters of Brazilian President-elect Jair Bolsonaro, gather at the "Tres Poderes" square in front of the Planalto Palace in Brasilia, before his inauguration ceremony on January 01, 2019. - Brazil entered a new chapter in its history on Tuesday, embracing a far-right president, Jair Bolsonaro, whose determination to break with decades of centrist rule has raised both hopes and fears. (Photo by EVARISTO SA / AFP)EVARISTO SA/AFP/Getty Images EVARISTO SA AFP/Getty Jair Bolsonaro: Brazil's far-right leader inauguration Supporters of Brazilian President-elect Jair Bolsonaro, gather to wait for his inauguration ceremony at "Tres Poderes" square in front of the Planalto Palace in Brasilia, on January 01, 2019. - Brazil entered a new chapter in its history on Tuesday, embracing a far-right president, Jair Bolsonaro, whose determination to break with decades of centrist rule has raised both hopes and fears. (Photo by EVARISTO SA / AFP)EVARISTO SA/AFP/Getty Images EVARISTO SA AFP/Getty Jair Bolsonaro: Brazil's far-right leader inauguration Jair Bolsonaro addresses Congress, during his swearing-in ceremony as Brazil's new president, in Brasilia on January 1, 2019. - Bolsonaro takes office with promises to radically change the path taken by Latin America's biggest country by trashing decades of centre-left policies. (Photo by NELSON ALMEIDA / AFP)NELSON ALMEIDA/AFP/Getty Images NELSON ALMEIDA AFP/Getty

It is not yet clear what political role Lula will seek to occupy now that he is free. The former leader of the leftist Workers' Party, better known in Brazil by its Portuguese acronym PT, remains a popular figure on the left, whose politicians and voters have ceaselessly called for his release.

Political analysts believe the release could rally the opposition, which has been demoralised by the corruption scandals, impeachment of Lula’s hand-picked successor, his imprisonment and, more recently, a clobbering in the 2018 general elections.

Aside from his promise to root out corruption and curb violence, far-right president Jair Bolsonaro ran a strong campaign on anti-Workers Party sentiment. He won the election with 55% of the vote and was sworn in on 1 January.

Lula, who governed from 2003 to 2010, had been favoured to win the 2018 presidential election, but his conviction eventually prohibited him from running.

The former president has said that when free, he would travel around the country rallying opposition. Political analysts say he might not immediately enter into frontal opposition with Mr Bolsonaro, seeking instead to influence the next presidential election in 2022.

“The thing that makes Lula most dangerous to Bolsonaro is that Lula understands the long game,” said James Bosworth, founder of Hxagon, a political risk analysis firm, stressing that the politician had run four times before being first elected in 2003.

“Lula is an old school union and political organisers who is going to take his time placing PT and other allies into positions to take advantage of Bolsonaro's weaknesses in the coming years,” he said.

The former union leader is widely referred to as a “political animal”. He presided over a period of rapid economic growth fuelled by a commodities boom that expanded the country's middle class.

His huge Bolsa Familia welfare program helped lift millions from poverty, and he left office with an approval rating above 80 per cent. His impassioned oratory can just as easily elicit laughter or tears from those among his supporters.

For Claudio Couto, a professor in political science at the Fundacao Getulio Vargas university in Sao

hand, it ends the PT's 'Free Lula' rhetoric, and forces the party to take on another agenda.“

Left-leaning supporters hailed the release of their standard-bearer, but want more and are now advocating for his name to be cleared.

While he is out of jail, the former leader remains entangled in several court cases.

Aside from the beachfront apartment, he was also sentenced by a lower court judge in a case regarding alleged ownership of a farmhouse in Atibaia, outside Sao Paulo.

He has denied any wrongdoing in both cases and accuses Car Wash prosecutors and then-judge Sergio Moro, now Justice Minister, of political persecution.

In a separate Supreme Court debate, justices will decide whether Mr Moro was biased when he delivered his rulings. In the meantime, his conviction regarding the apartment continues to bar Da Silva from running for office.

Protests in major Brazilian cities have been scheduled for this weekend, aimed at showing support for Mr Moro and his crusade to decrease crime and endemic corruption.

With Lula’s release, attacks on the Supreme Court’s ruling will doubtless feature loudly.