Despite these well-documented atrocities, more than 30 years after the end of military rule some people in Brazil seem comfortable speaking in support of the military regime. During an anti-government protest last year, old ladies held signs that read: “Why didn’t they kill them all in 1964?” and “Dilma, it’s a pity they didn’t hang you at the DOI-CODI.” At family dinners and in taxicabs, you can hear talk of how things were better when the generals were in charge.

Brazil’s political class is caught in a huge corruption scandal. The government, led by the left-wing Workers Party, is unpopular, and Ms. Rousseff’s removal from office looks imminent. Under these conditions, it seems it has gotten easier to be an advocate of the far right, praising convicted torturers as if they saved the country from much worse terror.

Mr. Bolsonaro, who represents the state of Rio de Janeiro, is the most public face of this movement. He has been advocating for a return to military rule for more than 20 years but these days his message is finding new resonance. He was re-elected by his widest margin yet in 2014, and he’s the favored possible presidential candidate among rich Brazilians for the 2018 election, capturing 15 to 23 percent of their votes in recent polls. But he is hardly alone.

Alongside other conservative politicians, he belongs to the powerful “BBB caucus” — short for “bullet, beef and Bible,” since they represent the interests of security forces, agribusiness and evangelical churches. Not all of the caucus’s members are wistful for the days of the military regime — at least not openly — but they seem to prefer right-wing dictatorship to democratic government run by the left. One congressman wears a military uniform to work and refers to the 1964 coup as a “democratic revolution.”

Authoritarian nostalgia now seems to be a trend. Mr. Bolsonaro says that what Brazilian people miss most are the moral values of the military: “There was decency and respect for the family. Things today are disgraceful,” he said in an interview with a news website, specifically mentioning the legalization of marijuana as one of the many moral failings of today’s Brazil.