BERLIN — A populist far-right German party that has fiercely attacked the government for letting in more than a million refugees in the last year is expected to be the big winner in three important state elections Sunday that will serve as a referendum on Chancellor Angela Merkel's controversial open-door policies.

The party has aimed its appeal to German voters with a strong anti-foreigner bent that has some similarities to Donald Trump's bid to win the Republican nomination for U.S. president.

The Alternative for Germany party, or AfD, has campaigned hard against refugees streaming into the country, and it has surged in public opinion polls from about 3 percent last summer to as high as 20 percent ahead of elections in three of Germany's 16 states. That is far above the 4.7 percent the AfD won in the 2013 federal election just half a year after it was formed mainly to oppose Europe's single currency, the euro, and the expensive European Union financial bailouts to Greece.

Political leaders across the board say there is zero chance of the AfD taking power in the states of Baden-Wuerttemberg, Rhineland-Palatinate or Saxony-Anhalt because the other four mainstream parties running in those states have vowed to reject any kind of a coalition with it. Still, the AfD's projected electoral triumphs have upset the political establishment in Germany.

The party's success could give Merkel a black eye in the most important German elections this year ahead of the 2017 federal election. It may also make it harder for the other parties to pull together 50 percent of the seats in the state assemblies to form working coalitions after the bellwether vote.

“These state elections and the increasing strength of the AfD could cause a considerable amount of uncertainty for Merkel,” said Thorsten Hasche, a political scientist at the University of Goettingen. “It's usually only state issues that decide these elections, but this time it's all been turned into a referendum on Merkel's refugee policies.”

Hasche said the AfD, which is polling between 10 percent in the rural western state of Rhineland-Palatinate and 20 percent in the impoverished eastern state of Saxony-Anhalt, has succeeded in tapping support from frustrated voters with low incomes and educations the same way that Trump has attracted many such voters in the U.S.

“Trump has won over voters who are disappointed with the establishment, and the AfD has won over voters disappointed with mainstream parties,” he said.

A number of small postwar far-right parties have emerged in Germany, but, because of its Nazi past, they by and large have been repudiated after surges in support to as high as 10 percent. None have held seats in any state or federal government, and support for most all but collapsed within a few years.