SÃO PAULO, Brazil — Just as former President Luiz Inácio Lula da Silva, the front-runner in Brazil’s presidential election, was surrendering this month to start serving a 12-year sentence for corruption, a former Supreme Court justice quietly made his debut on the political stage, quite possibly upending the contest.

Joaquim Barbosa, who made history in 2003 when he became the country’s first black Supreme Court justice, registered with the center-left Brazilian Socialist Party on April 6, one day before the deadline for potential presidential candidates to join a party.

While he has yet to formally begin a campaign, party leaders have spent the past few weeks building a strategy that draws on Mr. Barbosa’s remarkable biography. Having overcome poverty and discrimination to reach the pinnacle of the legal profession, Mr. Barbosa became a crusading figure in the fight against corruption, which is the top concern among Brazilian voters.

“His campaign won’t be based on polarization,” Carlos Siqueira, the president of the party, said in an interview. “It will be about his clean, honest name and about a black man who comes from humble origins and made it to the Supreme Court and now could reach the presidency.”