Thousands of supporters of Luiz Inácio Lula da Silva have gathered to see the former Brazilian president after he was released from prison.

Lula spoke at a metal workers union meeting near Sao Paulo on Saturday, and was greeted with applause and cheers by the crowd.

The left-wing leader had spent 18 months in jail on corruption charges.

But a judge ordered his release after a Supreme Court ruling that defendants should only be imprisoned if they had exhausted all appeal options.

In a 45-minute speech to members of the union he once led, Lula attacked his rival, right-wing President Jair Bolsonaro, for his record in office.

"People are hungrier, they have no jobs, people work for Uber or delivering pizzas on a bike," Lula said in remarks sometimes drowned out by cheers from the crowd and fireworks overhead.

Mr Bolsonaro tweeted that Lula was "momentarily free, but guilty".