Chancellor Angela Merkel's conservatives have lost out in two out of three regional state elections as Germans gave a thumbs-down to her accommodating refugee policy with a big vote for the anti-immigration Alternative for Germany (AfD).
Sunday's poor showing in both Baden-Wuerttemberg and Rhineland-Palatinate represented a worst-case scenario for Merkel, who has staked her legacy on her decision last year to open Germany's doors to over 1 million migrants.
The backlash was also visible in Saxony-Anhalt in former East Germany, where Merkel's conservative Christian Democrats (CDU) remained the largest party but the AfD grabbed 21.5 per cent.
"We have fundamental problems in Germany that led to this election result," said AfD chief Frauke Petry, whose party entered all three regional parliaments.
The result is a setback for Merkel just as she is trying to use her status as Europe's most powerful leader to seal a European Union deal with Turkey to stem the tide of migrants.
She alarmed many EU leaders last week by agreeing a last-minute draft deal with Turkey to stop the migrant flow and demanding their support. Now weakened by the state polls, she must seek their backing again later this week to seal the deal.
In Baden-Wuerttemberg in the southwest, a CDU stronghold for more than 50 years before turning to a Green-led coalition with the SPD in 2011 after the Fukushima nuclear disaster in Japan, the Greens came home first with 32.5 per cent. The CDU took 27.5 per cent, according to exit polls on the broadcaster ZDF.
Even more damaging for the CDU was the result in Rhineland-Palatinate, the state of former chancellor Helmut Kohl.
There, the CDU's Julia Kloeckner, who had positioned herself as a candidate to succeed Merkel one day, lost out to Social Democrat (SPD) incumbent state premier Malu Dreyer. The SPD won 37.5 per cent of the vote to the CDU's 33 per cent, the ZDF exit poll indicated.
In Saxony-Anhalt, the CDU remained the biggest party on 30.5 per cent, but the AfD grabbed 21.5 per cent, even surpassing the SPD, Merkel's coalition partner in Berlin. It was the first time the AfD had become the second-biggest party in any regional state.
Already represented in five of Germany's 16 regional parliaments, the anti-immigrant party campaigned on slogans such as "Secure the borders" and "Stop the asylum chaos".