By Paul Carrel and Michael Nienaber
BERLIN (Reuters) - Isolated in Europe, Chancellor Angela Merkel faces a big test at home on Sunday when three German states vote in elections that risk eroding her base and undermining the migrant policy on which she has staked her legacy.
Merkel, known for her caution, took the high-risk step last summer of opening Germany's borders to refugees fleeing war in Syria - a move that made her Time magazine's Person of the Year but stoked angst among Germans about integrating the migrants.
Now voters in the three states - two in the west, and one in the former east - have a chance to punish Merkel, 61, just as she is trying to use her status as Europe's most powerful leader to push through an EU deal with Turkey to stop the migrant flow.
"Merkel will continue to be chancellor, but maybe with a black eye," said Matthias Kortmann at the University of Munich.
Such a loss of face would erode Merkel's standing at a crucial juncture in her efforts to deal with the refugee crisis that saw over 1 million migrants arrive in Germany last year.
She alarmed many European leaders at a summit earlier this week by gambling on a last-minute draft deal with Turkey to stop the migrant flow and demanding their support.
But Merkel, whose gravitas and reputation for deal-making has grown during her 10 years in power, must still seal the Turkey deal with EU leaders at their next summit on March 17-18.
"If she cannot push through her approach then, she will not be able to avoid correcting her stance on refugee policy," said Oskar Niedermayer at Berlin's Free University.
Such a shift, which could include tightening Germany's borders, would be damaging to Merkel, who is expected to seek a fourth term in office at a federal election in 2017.
Snapping at the heels of her conservative Christian Democrats (CDU) is the Alternative for Germany (AfD) party, whose hardline stance on refugees could bring it big gains in all three states voting on Sunday.
Founded only in 2013, the AfD has morphed from an anti-euro zone bailout party into an anti-immigrant electoral force, to which the CDU is bleeding support in all three states.
The three regions - Baden-Wuerttemberg and Rhineland-Palatinate in the west, and Saxony-Anhalt in the east - have a combined population of some 17 million, a fifth of Germany's 81 million.
The AfD is strongest in Saxony-Anhalt, where unemployment is running at over 10 percent. Polls put the AfD on as much as 19 percent support in the state, and ahead of the Social Democrats (SPD), Merkel's coalition partner in Berlin, a humiliation for a party that is bracing for big losses on Sunday.
"In Germany, as in the U.S., the party system is fanning out to the extremes," said Josef Joffe, publisher-editor of German weekly Die Zeit.
A weakened CDU is still poised to come first in Saxony-Anhalt, but its fate looks less rosy in the two other states.
In Baden-Wuerttemberg, a CDU stronghold for over 50 years before turning to a Green-led coalition with the SPD in 2011 after Japan's Fukushima nuclear disaster, the Greens' state premier Winfried Kretschmann, 67, is poised to pip his CDU rival.
But it is Rhineland-Palatinate, a wine-growing region, that is shaping up as the pivotal swing state.
There, Julia Kloeckner, a charismatic 43-year-old former German "wine queen" who has positioned herself as a candidate to succeed Merkel one day, has seen her lead shrink in recent weeks and is now neck-and-neck with SPD incumbent, Malu Dreyer.
"Whoever wins Rhineland-Palatinate, CDU or SPD, can present themselves as the overall winner," said Kortmann.
Merkel will campaign on Friday in Trier, an ancient Roman town in Rhineland-Palatinate, but she is having difficulty in getting her overall popularity as chancellor to rub off on the CDU's candidates in the state elections.
A poll this week put support for Merkel at its highest this year, with her winning 50 percent of votes in a hypothetical presidential-style election against SPD leader Sigmar Gabriel, on 13 percent.
"Depending on the outcome (of the state votes), Merkel could be weakened domestically, especially within her own party," said Kortmann. "But everybody knows that there is actually no alternative to her in the CDU."
(Editing by Alison Williams)