Just three weeks after being elected president of Cyprus, Nicos Anastasiades traveled to Brussels for his European debut last Thursday. His fellow leaders were all friendly enough.
Hours before he was due to attend his first European summit, he met Germany's Chancellor Angela Merkel and other new colleagues at a cocktail reception.
At the meeting for center-right politicians in a swanky hall opposite the Belgian king's palace, Merkel congratulated him on his election victory. According to one person who attended, Anastasiades asked his new friends to make sure any bailout for Cyprus was fair.
Less than 48-hours later, when the deal was finally announced by exhausted officials in the pre-dawn hours of Saturday morning, it seemed anything but.
Cyprus was forced to announce a plan to claw back a levy on deposits from savers in its banks, including - most controversially - a big charge on those with small deposits that were supposed to be guaranteed by its deposit insurance scheme.
The outcome caused fury on the streets of the Mediterranean island state, where people quickly emptied out the cash machines to get at their savings. By Monday morning, the jitters spread across the continent, with share prices falling in London, Frankfurt and Paris.
Cyprus - barely 0.2 percent of Europe's economy - was the tail wagging the EU dog, sowing uncertainty that raised the prospect that savers elsewhere would flee their banks.
According to insiders who attended the negotiations, the big hit to ordinary Cypriot savers was an outcome that nobody seemed to be seeking but no one could find a way to prevent.
Merkel's government and EU officials were determined to make depositors pay. Anastasiades was determined to cap the levy on the wealthiest depositors at no more than 10 percent.
That meant that small savers in Cyprus were forced to pay a levy as high as 6.75 percent of their deposits, a move that effectively rips up the protection savers thought they enjoyed on insured deposits of up to 100,000 euros.
The opposition in Cyprus called the deal "bank robbery".
Anastasiades's government was scrambling on Monday to come up with a new formula that would put more of the burden on rich, uninsured depositors and prevent a full-scale run on the banks when they reopen after a holiday weekend.
Meanwhile, European and Cypriot officials are trading blame for a decision which threatens to undermine confidence in the financial system across the continent.
Although euro zone leaders were all in town for their summit, they left the most fateful decisions until after they went home on Friday night. Instead, it fell to their finance ministers, who gathered in the emptying red marble European Council building after their bosses cleared out.
With the leaders' summit over, there were just a few journalists left, clustered at the long empty tables in the building's huge atrium. Finance ministers met five floors up.
From the outset, the Cypriot delegation seems to have misunderstood the determination of Merkel and other leaders to force Cypriot depositors to pay.
Merkel's Finance Minister Wolfgang Schaeuble had gone to Brussels with a firm mandate from Berlin: "no bail-in, no bailout", said a member of her government. That meant: unless depositors took a hit, there would be no agreement and Germany would not contribute towards a package for Cyprus.
European officials set on a figure of 5.8 billion euros to come from depositors, and refused to budge. What they had not decided in advance was how much of that should come from big, uninsured depositors, and how much from ordinary savers.
Under a promise which still appears on the website of the Central Bank of Cyprus, deposits in its banks are insured up to 100,000 euros. Cyprus has about 30 billion euros in insured deposits, a large amount for a country of just 1 million people.
But because of its status as an offshore financial hub for foreigners - including large numbers of rich Russians - it also has 38 billion euros in uninsured deposits in bigger accounts.
Cyprus could have offered full protection to those with insured deposits up to 100,000 euros and still reached the 5.8 billion euro target by taxing uninsured deposits at a rate above 15 percent.
According to three sources, European Central Bank board member Joerg Asmussen and euro zone finance ministers' representative Thomas Wieser had worked on a plan that would require just that - a high levy on only uninsured deposits.
But when the plans were presented to Anastasiades, several participants said, he balked at any suggestion that uninsured depositors should pay more than 10 percent.
Since his limit meant uninsured depositors would pay no more than 3.8 billion euros, those with small savings would have to pony up the other 2 billion euros.
The meeting was contentious, participants say. Schaeuble, Dutch Finance Minister Jeroen Dijsselbloem and negotiators for the ECB, EU and International Monetary Fund broke off several times to talk separately with the Cypriots. Other ministers hung around in the corridors, playing games on their mobile phones.
In the early hours of Saturday morning, Dijsselbloem, who serves as head of the euro zone minister's group, proposed that uninsured depositors pay 12.5 percent, a level which would require insured depositors to pay only 3.5 percent or so.
Anastasiades stormed out of the meeting in anger. He returned only when senior negotiators told him that if he left, Cyprus would have to default and shut its banks altogether.
Finally he agreed to the levy, but insisted on capping the fee for uninsured depositors at no more than 9.9 percent.
Exhausted officials did the sums. To raise the other 2 billion, insured Cypriot depositors with small accounts would have to pay a 6.75 percent levy on their savings. The deal was done.
When they finally announced the bailout at a 4:00 a.m. news conference on Saturday morning, the financial officials who signed on to the deal seemed so embarrassed by the deposit levy that they spoke without mentioning it at all.
A tired-looking Christine Lagarde, head of the International Monetary Fund, appeared to have lost track of the calendar and wished weary reporters a "happy St Patrick's Day" a full day early. She made no reference to a deposit levy, talking only of "burden sharing".
Dijsselbloem referred only to "certain unique measures".
But news of the deposit levy was already out. Only when reporters pressed him about it did Dijsselboem acknowledge it, growing irritated.
"We found it justified," he said.
One senior EU official who attended the negotiations said when he realized the outcome he wanted to vomit.
Several EU officials blamed Anastasiades for insisting on low contributions from uninsured deposits, hurting his country's small savers to protect wealthy depositors, many foreigners.
They say he was trying to protect Cyprus's status as an off-shore financial haven, even by punishing ordinary Cypriots.
Anastasiades's government scrambled on Monday to find a new formula that would ease the pain for small savers, but by hurting confidence, the initial deal already did damage, and not just to Cyprus.
"The spirit of protecting deposits has been completely sidestepped. Hitting depositors is no longer hypothetical," said one official from a euro zone country. "The Cypriot government was keener to protect its banking model, which has turned out to be a disastrous political mistake."
(Additional reporting by Michele Kambas in Nicosia, Robin Emmott in Brussels, Paul Taylor in Paris and other Reuters correspondents; Writing by Peter Graff; editing by Anna Willard)