By Madeline Chambers
BERLIN (Reuters) - Angela Merkel's face-saving deal with her conservative allies in Bavaria shows how indispensable the chancellor is to her party - even if she is weakened.
Merkel has not resolved the underlying tensions in her coalition. But a dearth of credible challengers to lead her Christian Democrats (CDU) and a general fear among many Germans of the far-right keep her hanging on, possibly even to the next election in 2021.
After nearly 13 years at the helm of Europe's biggest economy, many experts had expected the 63-year-old chancellor would not serve her whole term, especially given the clause in the coalition's deal allowing the parties to review progress in two years.
"Both the chancellor and (Bavaria's Horst) Seehofer are damaged. This is an agreement that cannot be implemented but it allows both of them to save face," said Thomas Jaeger, politics professor at Cologne University.
But he added: "She has made it her lot in life to be German chancellor. She is here to stay."
Barely returned from Brussels where she helped hammer out a European Union pact to control immigration, Merkel was forced on Monday to redeploy her skills on the same subject to pull her shaky coalition back from the brink of collapse.
The deal agreed with the Christian Social Union (CSU) sets up transit centres on the border with Austria to reduce the burden of more than 1.6 million migrants since 2014, a result of Merkel's open-doors refugee policy.
The compromise, which also depends on her Social Democrats (SPD) coalition partners and Austria giving it the nod, met scathing criticism in the German media. "Poisoned solution" was the headline on an editorial in the top-selling daily, Bild.
The CSU had threatened tighter border controls which Merkel rejected, insisting on a European solution.
The compromise leaves one of Merkel's biggest headaches unresolved: a deep rift with the CSU before a state election in October where it faces a stiff challenge from the far-right Alternative for Germany (AfD).
In particular, she still has to work with CSU leader and German Interior Minister Seehofer, with whom she has had several showdowns on different aspects of migrant policy.
The last two weeks have laid bare the poisoned nature of their relationship. A defiant Seehofer told the Sueddeutsche daily: "I will not let myself be dismissed by a chancellor who is only chancellor because of me."
Merkel's coalition would lose its parliamentary majority without the CSU.
Joerg Kraemer, chief economist at Commerzbank said much trust had been destroyed. "This is a difficult basis for the rest of the legislature and poses at least a latent threat to the stability of the government," he said.
The two did not even put on a united front after the breakthrough: after five hours of talks, a relieved-looking Seehofer and matter-of-fact Merkel addressed reporters separately after their deal was struck.
Experts see more disputes in the weeks and months ahead, for example on plans for euro zone reform to which the CSU objects.
However, the row with the CSU appears to have galvanised support for Merkel within the CDU ranks, even though many members prefer Seehofer's policies.
"We will not let our chancellor be shot away by the little sister party," one senior CDU lawmaker told Reuters.
While she still has CDU backing, Merkel is safe.
One reason is that she has no obvious challenger after seeing off several potential rivals over the years.
Protege Annegret Kramp-Karrenbauer, CDU general-secretary, may eventually take over but analysts say her profile is too low for the CDU to back her and Jens Spahn, her biggest critic within the party, is not popular enough with voters.
"The CDU does not tend to ditch its leaders unless it realises the Titanic is sinking," said Jaeger.
Merkel's position is also bolstered by polls, several of which show that voters back her European approach. A Forsa poll on Monday showed 67 percent of Germans viewed Seehofer's position as irresponsible.
Concern among many voters and the main political parties about the growing strength of the AfD also supports her position.
On Tuesday, the AfD tried to capitalise on dissatisfaction with the migrant deal.
"Just because the conservatives are so scared of us, they have found no alternative to implement our demands," said AfD parliamentary leaders Alice Weidel and Alexander Gauland.
INSA pollster Hermann Binkert said the biggest winners of a new election would be the AfD and Greens. Its most recent poll put the AfD up half a percentage point at 16.5 percent, up from almost 13 percent in September.
The SPD, struggling to recover from its worst election result since 1933, is too weak to abandon Merkel and face a new vote.
All this leaves many commentators thinking that Merkel may just see out her whole term.
Merkel has never appeared rattled over the last stressful two weeks, and people who work with her say she was focused and relaxed in negotiations and did not lose her sense of humour.
(Additional reporting by Andreas Rinke; Editing by Sonya Hepinstall)