Germany is in an unexpected political stalemate. This month, coalition talks among quarreling parties collapsed, leaving who will govern the country in question. If it is unable to form a new government, Germany could hold national elections again, a dismal prospect for all.

In September, Germany’s chancellor Angela Merkel and her dominant Christian Democratic Union (CDU) lost big. The upstart Alternative for Germany (AfD) party surged in popularity.

Founded four years ago during the Greek financial crisis as an anti-Eurozone party, the AfD, pitching itself as an anti-immigrant party, secured third place in parliament with almost 13 percent of the popular vote. The reasons for AfD’s meteoric rise include “anxieties about national identity, globalization, migration, Islam and jobs” across the European continent, as the New York Times puts it.

Many votes for AfD were protest votes. To vote CDU was to condone Merkel’s role in Germany’s reckless open-borders policies beginning in 2015. A lot of middle-class, nationally minded Germans don’t want to excuse that. They’re happy to watch her squirm.

In some respects, the situation oddly parallels the U.S. Voting for Hillary Clinton — a much less admirable figure than Merkel — equaled saying you were happy with the Democratic status quo. For some, voting for Donald J. Trump might have been disagreeable, but protest was preferable to sanctioning policies clearly going in the wrong direction.

The U.S. and European press unfailingly label AfD “far right.” This phrase conjures goose-stepping Schutzstaffel and snarling Doberman pinschers, and it is intended to do so. But crypto-Nazi the party is not, in spite of unending efforts to characterize it as such.

AfD voters are generally traditional, bourgeois and religious, that is true. They are also three generations away from the horrors of the 1930s and 1940s. They are nationalists, not fascists, who tend toward the stolid and pious, not hip; take pride in German manners, customs, learning, and music; and revere order, property rights, and civil safety.

AfD leaders object to what they call “an invasion of foreigners” and “Islamization.” The party wants border controls and eased deportation, especially of alien criminals. It has not supported gay marriage — which Germany legalized this year — or expanded abortion rights. Many Germans turning to AfD think — with good reason — that government authorities disregard their jobs, safety, schools, and housing in favor of migrants and asylum seekers.

Recall what Merkel set in motion two years ago, backed by the European Union. A million or more uninvited, undocumented Mideast and North African migrants poured into Europe in a matter of weeks. Europe could not — or would not — protect its borders. Then and now, these trespassers sought refugee status or asylum, giving them staying and family reunification rights on account of EU and German rules.

Initially, many Germans — stoked by multiculturalism, guilt, and compassion — welcomed the newcomers. EU officials and economists professed migrants were essential engines of Europe’s population growth and future economic welfare. They were to be a reservoir of talent able to “rescue” stagnant economies. These far-fetched avowals of migrant value disguised the immediate attraction of cheap labor for employers and affluent urban professionals. Aliens fill unpleasant, low paying jobs and do manual labor that Germans of all ages shun.

“There is no question that the influx of so many people will still demand a lot from us,” Merkel said, but “our values, our traditions, our understanding of the law, our language, our rules, this is for anyone who wants to live here.” Unfortunately, it is now quite obvious these values, traditions, and understandings among newcomers are very spotty.

After two troubled years, it’s hard to keep pretending — and expect Germany’s taxpayers to bear the costs of bad policy. Merkel has made vacuous, insincere concessions to immigration restrictionists, to no avail.

Moreover, restrictionists have good reasons to fear hegira, that is, Islamic intentions to settle and colonize new lands in order to expand the faith. Syrians, Afghans, Turks, and North Africans live separately, some housed and fed on government dole, others living in slums as a demimonde. These uninvited “guests” don’t speak the language, possess few technical skills, and often abhor basic Western ideas. Few show any signs of integration into localities or any desire to do so.

Did Merkel and her allies really expect Arabs and Afghanis suddenly to drop the jihad and sharia stuff and adopt German ways? If so, they should resign instantly for their wholesale credulity.

As matters stand, Merkel — recently crowned leader of the EU and free world — cannot fully recover her loss. She no longer commands great confidence. Her reputation for competence and invincibility is shattered, even if the CDU glues together a new coalition or governs as a minority.

AfD seems destined to expand its reach, one reason why German officials want to avoid new elections. It is fearful the party might someday grow strong enough to make exclusion from parliamentary leadership impossible. “For now, German politics are a kind of poker game, with the main actors using the threat of new elections as a way to see whether a working coalition can yet be formed,” Times columnist Ross Douthat has observed.

Merkel and the leftist Social Democrats (SPU) find the prospect of AfD being Germany’s leading opposition party mutually distasteful, but starting this week, the political establishment will try to weld together a “grand coalition” to recapture government control.