(CNN) On Sunday, Jair Bolsonaro, a longtime far right politician, was elected president of Brazil . Bolsonaro's clear victory was the latest in a series of results around the world in which populists promising a strengthened sense of patriotism and pride have been elected by populations frustrated with the status quo. (Donald Trump's 2016 win fits nicely into that trend)

With Bolsonaro being described by some as Brazil's Trump, I reached out to Scott Mainwaring , the Jorge Paulo Lemann Professor for Brazil Studies at Harvard Kennedy School, for more on the Brazilian President-elect and his similarities (and differences) with American's current commander-in-chief.

Our conversation, conducted via email and lightly edited for flow, is below.

Cillizza: How big an upset -- if at all -- was Bolsonaro's victory in Brazil? Did we see this coming?

: Bolsonaro's win is a huge upset if we go back in time. A year ago, almost nobody thought that Bolsonaro would be a major contender. Six months ago, he was running second in election polls, with about 16% of the vote, but still, most analysts thought that the odds were heavily against him. It was only after he was stabbed at a campaign rally on September 6 that it became clear that he was likely to be one of top two vote winners and hence to get into the second round (In Brazil, if nobody wins 50% of the valid vote in the first round of balloting, there is a runoff).

As of September 6, it still seemed that there were five viable presidential candidates. By mid-September, Bolsonaro had established himself as one of the two leading candidates to get to the second round. Shortly before the October 7 first round of the presidential election, most surveys projected that he would win the first round with around 38% of the valid vote -- and he ended up with 46% . The first round result positioned Bolsonaro as the strong favorite to win the presidency

Cillizza: Bolsonaro is being cast as Brazil's Trump. True? And is Brazil today in a similar place that the US was in 2016?

Mainwaring: Bolsonaro and Trump have important similarities and important differences. Both ran as conservative populists railing against the establishment. Both have issued many statements that critics have viewed as racist and sexist. Both have defended torture and criticized the media as enemies of people. Both ran on socially conservative platforms and won a large majority of the Evangelical Christian vote. Both claimed to be able to tackle big problems that these two huge democracies faced. Both have threatened to imprison political opponents. Both have been criticized as authoritarian.

As for differences, Bolsonaro is far more extremist on most positions. For example, he once said that a woman member of the National Congress was too ugly to be worthy of raping. He has said that if one of his sons were homosexual, he would prefer that he die, and that a police officer who does not kill is not a police officer. Many years ago, Bolsonaro said that if he were elected president, on his first day in office he would shut down the National Congress.

Another difference is that unlike Trump, although Bolsonaro positioned himself as an outsider, he has served in the National Congress for 27 years. Bolsonaro has exhibited great ideological consistency over time; Trump has changed parties.

Brazil's problems in 2018 are vastly worse than the US's problems in 2016. By most objective measures, although not by some subjective ones, the US was in pretty good shape in 2016. In contrast, in recent years, Brazil has gone through the greatest corruption scandal in the world history of democracy. It has endured a severe recession, far longer and far deeper than the US recession of 2008-09. The corruption scandals were a major contributing factor in the economic crisis, creating voter cynicism deeper than in the US. And it has experienced a large spike in crime. The homicide rate in Brazil is six-and-a-half times higher than in the US: 32.4 homicides per 100,000 inhabitants compared to 4.9 per 100,000. Brazil has seven of the 20 most violent cities in the world

Cillizza: We've seen a lot of candidates espousing, essentially, "Make [Fill in the Blank Country] Great Again." Is this new? And why now?

Mainwaring: There is nothing new in candidates espousing that they can make their country great (again). It is a recurrent and frequent claim.

Cillizza: Put this in historical context. Have we seen movements like these rise (and fall) before?

Mainwaring: Yes.

As my colleagues Steve Levitsky and Daniel Ziblatt argue in their great recent book, How Democracies Die , there have been similar movements at earlier times in US history -- but none that gained the presidency. And there are some similarities to other populist leaders with authoritarian proclivities at many different historical moments and places. Juan Perón in Argentina (1946-55) and Hugo Chávez in Venezuela (1999-2013) were leftist presidents who claimed to represent the people, railed at the establishment and attempted to dismantle democratic checks and balances. Alberto Fujimori of Peru (1990-2000), Vladimir Putin, Viktor Orban and Recep Erdogan all have some similarities in these respects.

All of the movements cited here had long-lasting effects, but others come to power and fizzle out, or they never come to power.

Cillizza: Finish this sentence: "The lesson to learn from elections of people like Bolsonaro and Trump is _________." Now, explain.

Mainwaring: "Democracy is facing troubled times."

After a generation of almost constant democratic gains for the world from 1974 to the mid-2000s, democracy has broken down in several important countries, including Russia, Turkey and Venezuela (and Nicaragua, a much smaller country). And, the level of democracy has clearly declined in Hungary, Poland and India.

We are still living in one of our planet's most democratic times ever, but it is a time of potential peril.