Former Brazilian president Luiz Inacio Lula da Silva has been released from prison and vowed to "free Brazil from madness." The current president, Jaire Bolsonaro, immediately attacked him anonymously.

Da Silva, who was Brazil's president from 2003 to 2010, posted a video on social media saying he would "free" the country from the "madness", and said he felt he had the energy of a 74-year-old.

Crowds of Brazilians met da Silva's call for a rally on Saturday at the headquarters of the Steel Workers' Union on the outskirts of Sao Paulo, where he had a political start.

A judge ordered the release of Da Silva on Friday after the Supreme Court ruled that prisoners in criminal cases should be released despite losing their first appeal.

Da Silva was waiting outside the prison in Curitiba, a crowd of supporters chanting in red in the color of his Labor Party banner.

He vowed in his first speech to his supporters to fight to prove his innocence and accused the police of "rottenness", prosecution and the judiciary "of working to criminalize the left." Lula was jailed last year after being convicted of taking bribes from construction companies in exchange for government contracts, preventing him from running for president.

"Don't give ammunition to a bastard who is temporarily free but mired in mistakes," Brazilian President Jaire Bolsonaro wrote on Twitter, without naming Da Silva.

Bolsonaro called on his supporters to rally around the government's right-wing policy, adding that they should not allow the "new phase of Brazil's recovery" to derail.

"O lovers of freedom and goodness, we are the majority," he said. "Without a mentor, the best forces are just a squad firing in every direction, including friends."