Jair Bolsonaro is a right-wing Brazilian who holds repulsive views. He has said that if he had a homosexual son, he’d prefer him dead; that a female colleague in the Parliament was too ugly to rape; that Afro-Brazilians are lazy and fat; that global warming amounts to “greenhouse fables.” He is nostalgic for the generals and torturers who ran Brazil for 20 years. Next Sunday, in the second round of voting, Mr. Bolsonaro will most likely be elected president of Brazil.

Behind this frightening prospect is a story that has become alarmingly common among the world’s democracies. Brazil is emerging from its worst-ever recession; a broad investigation called Operation Car Wash has revealed wanton corruption in government; a popular former president, Luiz Inácio Lula da Silva, is in prison for corruption; his successor, Dilma Rousseff, was impeached; her successor, Michel Temer, is under investigation; violent crime is rampant. Brazilians are desperate for change.

Against this background, Mr. Bolsonaro’s gross views are construed as candor, his obscure career as a congressman as the promise of an outsider who will clean the stables and his pledge of an iron fist as hope of a reprieve from a record average of 175 homicides a day last year. An evangelical Christian, he preaches a blend of social conservatism and economic liberalism, though he confesses to only a superficial understanding of economics.

Sound familiar? He is the latest in a long line of populists who have ridden a wave of discontent, frustration and desperation to the highest office in each of their countries. Not surprisingly, he is often described as a Brazilian Donald Trump.