Prominent social scientists and historians are debating whether the United States could become authoritarian. Cass Sunstein’s collection on the topic asks “Can It Happen Here?” Steven Levitsky and Daniel Ziblatt outline “How Democracies Die.” And Yale historian Timothy Snyder draws on interwar history to outline “The Road to Unfreedom.”

In a recent article in Perspectives on Politics, we assess these risks by looking at how elected leaders in Venezuela, Hungary and Turkey established autocratic control in countries that at one time seemed on the road to democracy.

Like President Trump, these leaders — Venezuela’s Hugo Chávez, Hungary’s Viktor Orban and Turkey’s Recep Tayyip Erdogan — were chosen through free and fair elections. Once in office, however, they exploited their authority to undermine constitutional constraints, curtail civil and political liberties, and lock themselves into power. Our research explores whether a similar future could be possible in the United States.

The short answer: It’s very unlikely. The United States is vastly more affluent than these three middle-income countries, and academic research shows a strong relationship between wealth and the stability of democratic rule. U.S. political institutions, moreover, are far more deeply entrenched.

Nevertheless, we also see parallels that could impair — perhaps deeply — the quality of American democracy.

There are two important parallels between Trump and the middle-income autocrats

Two similarities are especially striking. One is the political exploitation of underlying social and economic divisions. Trump’s appeals to racial and ethnic antagonisms within the electorate bear a strong resemblance to the right-wing populist strategies used by both Erdogan and Orban. Meanwhile, although Chávez ran from the left, his populist campaign for the support of working-class voters hurt by the country’s prolonged recession paralleled Trump’s promises of economic relief for blue-collar workers threatened by automation and globalization.

In all these cases, social polarization — partially stoked by the leaders themselves — encouraged voters to frame their choices in stark, binary terms: between “the people” who supported the autocrats and political opponents who were branded as elitists, criminals and traitors.

A second important parallel is the incremental weakening of checks on executive power. Authoritarianism did not arrive all at once, such as by coup. Rather, once in office, Chávez, Orban and Erdogan gradually undermined the independence of the courts, turned law enforcement agencies against their political enemies and threatened the press with economic and legal sanctions. Removing these checks cleared the way for unbridled corruption, protection for crony capitalists, and a political playing field sharply tilted toward the leaders and their parties.

Trump has not gone that far, but he has threatened actions out of the authoritarian playbook. He has regularly attacked the integrity of judges who rule against his initiatives; threatened to “lock up” political rivals without due process; and relentlessly attacked the press as “enemies of the people.”

Such threats are far from empty. Just this month, news emerged that Trump wanted to order the Justice Department to prosecute former FBI director James B. Comey and former political rival Hillary Clinton. And in another recent strong-arm move directed against critics in the media, the president tried to withdraw the White House credentials of CNN’s Jim Acosta as a punishment for persistent questioning during a news conference.

But there’s a third factor that the U.S. does not fully share

In our study of middle-income countries, we identify a third factor that was crucial to executive backsliding: large legislative majorities that abandoned oversight and ratified the concentration of power in the hands of the president or prime minister.

Chávez took the most radical such action: He simply set up a new constituent assembly that took the place of the existing congress. In Hungary and Turkey, the rules that converted citizens’ votes into legislative seats overrepresented the largest parties. As a result, both Orban and Erdogan gained commanding parliamentary majorities that substantially exceeded the proportion of votes won at the ballot box.

The legislative victories of the middle-income autocrats also marginalized the opposition parties, leaving them no way to block the transfer of power to the executive branch. Chávez, Orban and Erdogan capitalized on this opportunity to weaken institutional checks and balances, undermine civil liberties, and even rewrite their countries’ constitutions.

Creeping authoritarianism thus advanced within an ambiguous legal framework, backed by a legislative majority, making it difficult to challenge on constitutional grounds.

Trump has had weaker command over Congress throughout his time in office. Even with the partisan majorities he enjoyed during his first two years, he has not been able to gain congressional support for some key priorities, such as funding a border wall, easing sanctions against Russia or carrying out the administration’s family-separation policy at the border with Mexico.

Moreover, unlike in Venezuela, Turkey and Hungary, the U.S. Congress has stood up for its constitutional prerogatives and refused to cede significant formal powers to the president.

But until the Democratic victory in the election for the House of Representatives, there was at least the possibility that Republican congressional majorities could have slowly yielded to Trump’s authoritarian tendencies. The midterms’ results have eliminated this possibility, at least for the near term. In contrast to what happened in the middle-income countries, there is now a strong legislative opposition that can push back against abuses of presidential power by investigating obstructions of justice, the weaponization of law enforcement and pervasive violations of civil rights.

That doesn’t mean the U.S. is safe from an erosion of its democracy

But democracy in the United States still faces many challenges similar to those that led to democratic decline in Venezuela, Hungary and Turkey. The midterm elections continued to reflect deep partisan division on virtually all major political issues and may well have exacerbated high levels of racial, ethnic and class polarization.

Although the Republicans will no longer control the House, the GOP Senate will continue to approve Trump’s judicial nominees, remaking the judiciary into one that is even more partisan than before.

What’s more, independent of the legislature and the courts, the president retains substantial unilateral authority he can deploy incrementally to curb the rights of minorities, immigrants and other vulnerable populations and to subvert the independence of the Justice Department, the special prosecutor’s Russia investigation and other institutional checks within the executive branch itself.

And so, if the United States escapes the autocratic fate of the middle-income countries, its democracy is likely to remain badly damaged even after the Trump era comes to an end.

Stephan Haggard is a distinguished professor at the School of Global Policy and Strategy at the University of California at San Diego.

Robert Kaufman is a distinguished professor in the Department of Political Science at Rutgers University.

Together they are the authors of “Dictators and Democrats: Elites, Masses and Regime Change” (2016).