A sign reading "State Border" on a fence at Hungary's border with Serbia near the village Asotthalom, Hungary, on April 8. (Darko Vojinovic/AP)

HUNGARIAN PRIME Minister Viktor Orban has become a virtual pariah within the European Union because of his dismantling of his country’s democratic institutions, cruel treatment of asylum seekers and anti-Semitic provocations. But on Monday he is due to be welcomed to the White House by President Trump, who appears to prefer crude autocrats of Mr. Orban’s type to the liberal democratic leaders of the United States’ closest allies.

The Oval Office meeting will be a triumph for Mr. Orban, who was rightly shunned by Presidents Barack Obama and George W. Bush and who shut down Hungary’s opposition media, eliminated independent courts, drove a prestigious U.S. university out of Budapest and spewed hateful rhetoric toward Muslims and, in more subtle terms, Jews. In March, Mr. Orban’s party was suspended from the European Parliament’s right-wing People’s Party because of such acts. Now, as elections to the European Parliament approach, he can flaunt his de facto endorsement by Mr. Trump.

U.S. officials portray the Hungarian leader’s rehabilitation as part of an effort to steer him away from Russia and China, with which his government has been cultivating ever-closer relations. But as the ambassador whom Mr. Trump posted in Budapest, David Cornstein, recently confirmed in an interview with the Atlantic, Mr. Trump’s interest in Mr. Orban goes well beyond the tactical. “I can tell you, knowing the president for a good 25 or 30 years, that he would love to have the situation that Viktor Orban has, but he doesn’t,” Mr. Cornstein said.

That “situation” includes nine continuous years in office thanks to increasingly unfair elections, the construction of a razor wire fence along Hungary’s southern border to prevent the entry of asylum seekers and the articulation of an ideology of “illiberal democracy” whose explicit aim is to preserve Hungary’s white and Christian identity. Mr. Orban’s last election campaign a year ago was centered on the claim that the Budapest-born billionaire George Soros, who is Jewish, was plotting to overwhelm Hungary with Muslim immigrants.

Said Mr. Orban: “We are fighting an enemy that is different from us. Not open, but hiding; not straightforward, but crafty; not honest, but base; not national, but international; does not believe in working, but speculates with money.”

Mr. Trump’s affinity for this demagogue is matched by his administration’s steadily worsening relations with traditionally close U.S. allies such as Germany and France. On the same day that the White House announced Mr. Orban’s visit, Secretary of State Mike Pompeo abruptly canceled a meeting with German Chancellor Angela Merkel. As Europe’s centrist parties struggle with a growing challenge from far-right parties with racist and authoritarian agendas, the United States ought to be doing all it can to bolster liberal democracy, especially in those parts of Europe where its roots are shallow. Instead, with increasing boldness, Mr. Trump is siding with democracy’s enemies.