Luiz Inácio Lula da Silva, six years after leaving Brazil’s presidency as a widely popular figure, now faces prison after a criminal conviction as well as vehement opposition from a segment of the population that formerly adored him. Mr. da Silva was once a national hero whose endorsement was enough to decide elections, but now his 2018 presidential bid looks uncertain.

It is not just Mr. da Silva, often affectionately called Lula, who has changed in those intervening years. Brazil has also changed around him.

Its political system has long been built on notoriously pervasive corruption. While Mr. da Silva has only recently been personally implicated, it has never been a secret that corruption is just how things work. The saying “rouba mas faz” — he steals, but he gets things done — has been common for half a century.

That system is now being torn down, by a judiciary that has the strength and independence to challenge even the most powerful official and by a public that will no longer tolerate the old ways.