By Paul Carrel and Madeline Chambers
BERLIN (Reuters) - Chancellor Angela Merkel's conservatives lost out in two out of three regional state elections on Sunday as Germans gave a thumbs-down to her accommodating refugee policy with a big vote for the anti-immigration Alternative for Germany (AfD).
The 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 percent.
"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 percent. The CDU took 27.5 percent, 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 Merkelone day, lost out to Social Democrat (SPD) incumbent state premier Malu Dreyer. The SPD won 37.5 percent of the vote to the CDU's 33 percent, the ZDF exit poll indicated.
In Saxony-Anhalt, the CDU remained the biggest party on 30.5 percent, but the AfD grabbed 21.5 percent, 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".
Turnout in all three states was much higher than in 2011, rising by 5.7 percentage points in Baden-Wuerttemberg, by 9.7 points in Rhineland-Palatinate, and by 11.8 points in Saxony-Anhalt.
(Additional reporting by Joseph Nasr and Tina Bellon; Writing by Paul Carrel and Madeline Chambers; Editing by Kevin Liffey, Angus MacSwan and Peter Graff)