It worked for Trump. It took Le Pen nearly to the finish line. And it influenced the Brexit vote. Now, concern about unchecked immigration, especially of Middle East and African Muslims, looks like it might have an unexpected influence on Germany’s national elections this weekend.

It’s probably inevitable that Angela Merkel will win her fourth term as chancellor, keeping her Christian Democratic Union in the driver’s seat, though short of a majority of seats in the Bundestag. If that occurs, as expected, Merkel could form a so-called grand coalition with the left-leaning Social Democrats.

The real story of this election, however, is the last-minute surge of the right-of-center party, the Alternative for Germany, or AfD as it is known to voters. After open infighting among its leadership earlier this year, AfD has regrouped and looks like it might take more than 10 percent of the vote, meaning it can be represented in the German parliament.

It’s been almost impossible for an openly right-wing party to succeed in modern Germany, where the specter of Nazi rule still unsettles citizens. But Merkel’s open-arms policy to Middle East refugees has stretched her credibility with voters, who nonetheless respect her for keeping the national economy strong.

Still, a string of rapes and other assaults in Cologne two years ago, and other crimes attributed to refugees have put voters in a rebellious mood, and the AfD has benefitted from that dissatisfaction. AfD candidate Georg Pazderski laces his campaign speeches with dark warnings that Germany is being overwhelmed by outsiders. That message resonates especially strongly in regions of the former East Germany, where higher-than-average unemployment is blamed on immigrants.

Merkel, by contrast, has stuck to her position that Germany -- and for that matter the rest of the European Union – has a moral obligation to welcome refugees from the terror-torn Middle East and northern Africa, and scoffs at the notion that some of the influx of newcomers have terrorist ties.

Like Donald Trump, and France’s right-wing presidential candidate Martine Le Pen, the AfD is hoping that the appeal of its message is greater than the polls indicate. Indeed, as with Trump, AfD supporters appear uncomfortable revealing their true feelings to pollsters.

That may change on election day, and if it does, as with Trump, Germany could be facing a brave new world of uncertainty next week.