Europe's onerous bailout deal for Cyprus has burnished Angela Merkel's reputation as a tough defender of German interests and removed one of the biggest threats to her re-election prospects half a year before voters go to the polls.
But the agreement, struck in the early morning hours of Monday in Brussels, comes at a price. It is likely to fan resentment in southern Europe over Germany's bitter reform medicine and may ultimately increase the risk of backsliding by a reluctant government in Nicosia.
"Much more than with Greece, there is concern over program implementation, that bank restructuring will be circumvented and that deposit outflows cannot be stopped," said one senior European official who requested anonymity.
Merkel's aides refused to describe the deal, which was reached after tense negotiations that prompted Cypriot President Nicos Anastasiades to threaten his resignation, as a "total victory" for Berlin, as some leading commentators did.
But German officials did make clear they had got virtually everything they had been seeking in the run-up to the make-or-break meeting of finance ministers, central bankers and IMF officials.
After coming under sharp criticism for approving a deal last week that would have hit small savers in the Mediterranean island's over-sized banks, Germany and its allies reversed course and forced Anastasiades to accept a massive "bail-in" -- or forced losses -- for bigger depositors.
Popular Bank of Cyprus, also known as Laiki, will be shut down completely, while deposits in the country's biggest financial institution Bank of Cyprus will be slashed in half.
This kind of deal, which ends the island's status as an offshore financial center for rich Russians and Britons, had been Germany's wish from the start.
"We got what we always wanted, a bail-in that shrinks the over-sized banking sector in Cyprus," Finance Minister Wolfgang Schaeuble told reporters on Monday in Berlin.
The result virtually guarantees that the bailout will sail through the Bundestag lower house of parliament and leaves Germany's center-left opposition with precious little to gripe about.
Interviewed on German television on Monday, Greens leader Katrin Goering-Eckardt avoided speaking about the new deal altogether, instead criticizing the government for hurting confidence with last week's accord, which is now obsolete.
More importantly for Merkel, the agreement with Cyprus reinforces her image as a tough negotiator who is only prepared to expose German taxpayers to euro zone bailouts in return for the most painful of reform commitments.
She had taken a risk on Cyprus by demanding, initially via Schaeuble, heavy losses for Cypriot bank depositors and then refusing to budge.
Had Anastasiades not relented, Cyprus would have gone bankrupt, potentially spreading contagion across the single currency bloc for which Merkel would have been blamed.
To avoid that fate and prevent a repeat of the embarrassing deal that unraveled the previous week, sources at the Brussels negotiations said Merkel gave very clear instructions this time around that she wanted a deal sealed before the unwieldy Eurogroup, with its 17 finance ministers, convened.
This meant that a smaller group, led by European Council President Herman van Rompuy and also including European Central Bank President Mario Draghi and International Monetary Fund chief Christine Lagarde, ended up negotiating with Anastasiades and his Finance Minister Michael Sarris for much of the night, while Schaeuble and his counterparts waited.
Merkel and French President Francois Hollande were on standby, ready to be consulted at any time.
Still, the deal carries significant risks and could come back to haunt Germany and its partners down the line.
After a week in which Cypriot banks were shuttered, the country faces a substantial hit to its economy and the risk of further capital flight that could shatter the foundations on which the deal is based.
Then there is the question of how eagerly Anastasiades, whose only apparent victory on Monday was preserving the island's biggest bank in shrunken form, will implement a program he clearly didn't want.
"I am confident that the program will work, but let's be honest. At this moment, we cannot say exactly what the impact is going to be," European Commission President Jose Manuel Barroso said. "It will depend on the level of implementation and the commitment of Cyprus itself."
Merkel, who has been depicted in Nazi uniform by angry protesters in Nicosia over the past weeks, will also have to accept further damage to her image outside of Germany and a deepening of the divide between Europe's north and south.
German officials were peppered with questions on Monday about whether the Cyprus agreement would aggravate long-simmering resentment of Berlin within Europe, and perhaps even convince some states that Merkel's cure is worse than their disease.
For Nicosia's European partners and financial markets, one of the most positive aspects of the deal was that the Cypriot parliament did not have to approve it. But how long will Anastasiades be able to keep onside lawmakers who feel they've been mandated to by Berlin?
"It is far from clear that all the current members of the Euro area will be prepared to join Germany on this journey, once they have fully internalized how tough it is going to be," said J.P. Morgan analyst Alex White.
(Additional reporting by Annika Breidthardt; writing by Noah Barkin; editing by Philippa Fletcher)