German Chancellor Angela Merkel’s party suffered a major setback in key state polls Sunday over her liberal refugee policy, while the right-wing populist AfD recorded a surge as it scooped up support from angry voters.

Merkel’s Christian Democratic Union (CDU) lost in two of three states in regional elections, and scored a historic low in its stronghold Baden-Wuerttemberg where it came in second place after the Greens, according to projections based on early results published by public broadcasters ARD and ZDF.

The populist Alternative for Germany (AfD), which had sparked outrage by suggesting police may have to shoot at migrants to stop them entering the country, recorded double-digit support in the first elections they have stood for in all three regions.

The elections are the biggest since Germany registered a record influx of refugees, and are largely regarded as a referendum on Merkel’s decision to open the country’s doors to people fleeing war.

Bild daily called Sunday’s polls “a day of horror for Chancellor Merkel” as the stunning popularity of the upstart AfD was a clear punishment for her policy.

“The people who voted for us voted against this refugee policy,” said AfD deputy chairman Alexander Gauland.

“We have a very clear position on the refugee issue: we do not want to take in any refugees,” he declared.

AfD is projected to garner close to one in every four votes in the eastern state of Saxony-Anhalt — making it the second biggest political force there after the CDU.

In Baden-Wuerttemberg, the populists are credited with almost 15 percent, displacing Merkel’s CDU’s junior coalition partner Social Democratic Party (SPD) as the third biggest party.

In the southwestern region of Rhineland-Palatinate, AfD also came in third, although the SPD and the CDU had substantial leads.

Nevertheless, asked if Merkel should now overhaul her refugee policy, the CDU’s general secretary Peter Tauber said: “I don’t see that need.”

Likewise, Vice-Chancellor Sigmar Gabriel said the grand left-right coalition government would stand firm on its immigration stance.

“We have a clear position on refugee policies and we stand by that,” said the SPD leader.

– ‘This party hurts our country’ –

Germans had watched in growing alarm as 1.1 million asylum seekers arrived in the country in 2015 alone.

Despite facing intense pressure to change course, Merkel has resolutely refused to impose a cap on arrivals, insisting instead on common European action that includes distributing refugees among the EU’s 28 member states.

She reiterated her point on Thursday, insisting that imposing a limit on refugee numbers was merely a “short-term pseudo-solution”, and that the only measure that would sustainably bring numbers down was a “concerted European approach”.

As dissent has grown over her stance, AfD has capitalised on the darkening mood.

Founded in 2013 as an anti-euro party, AfD has since morphed into an anti-migrant outfit.

Welcoming Sunday’s outcome, AfD party leader Frauke Petry insisted that “we have competency and have not only spoken about migration policies in our election campaign”, but she conceded that that “was the theme for all parties and the people because it is such an emotional issue.”

Although the upstart party has seats in five regional parliaments and is represented in the European Parliament, it has so far made its biggest gains in former communist eastern states that still lag behind western Germany in jobs and prosperity.

But its inroads into western states have sparked alarm in a Germany mindful of its Nazi past.

On the eve of the vote, Interior Minister Thomas de Maiziere joined calls from both the political mainstream as well as civic and religious groups, urging the electorate to shun AfD.

“AfD has no political programme and no capacity to resolve problems,” he told Die Welt daily on Saturday. “We must make it clear — this party hurts our country.”

Merkel herself described AfD as a “party that does not bring cohesion in society and offers no appropriate solutions to problems, but only stokes prejudices and divisions”.

She has also shrugged them off as a temporary diversion saying that once her government’s policies show results on reducing migrant numbers, “I’m convinced that from there, the support that AfD is enjoying right now will drop off.”