Sao Paulo: When Brazil's former President Luiz Inacio Lula da Silva and Judge Sergio Moro meet for the first time in a courtroom on Wednesday, the contrasts - and the stakes - could hardly be greater.

One is the country's most popular president ever and the front-runner in next year's election - a former union leader who still whips up crowds with his fiery and folksy oratory. The other, a soft-spoken law professor who represents Lula's main obstacle to power.

Brazil's former President Luiz Inacio Lula da Silva speaks during the Workers Party congress on Friday. Credit:AP

The legacy and political future of Brazil's first working-class president are on the line as Lula testifies in one of the five criminal cases against him, part of the biggest corruption probe in the country's history.

While denying any wrongdoing, Lula and his lawyers have turned his defence into an attack on Moro himself, arguing the federal judge's track record in overseeing the country's biggest graft probe has undermined his impartiality. Lula's supporters are travelling from across Brazil to the southern city of Curitiba to protest outside the court.