It took all weekend, but European finance chieftains finally clinched a deal that will keep Cyprus afloat—by taking a heavy toll from their wealthiest customers. The deal will prevent Cyprus and its banking system from going bankrupt and will keep the island nation in the euro zone. However, the cost will be the complete shutdown of one of the country's biggest banks and a levy of as much as 30 percent on those who have the largest amounts of money stashed in the Mediterranean tax haven.

When Cyprus first unveiled its bailout proposal last week, it planned to raise about €5.8 billion by taxing every bank deposit in the country at somewhere between 6 and 10 percent. This naturally led to howls from most Cypriot citizens, in part because all bank deposits under €100,000 are meant to be insured against any losses. This new, re-negotiated deal protects those smaller accounts, but does so by taking an astounding one-time levy on the biggest account holders in the state's two largest (and shakiest) banks. The final figures have not been released yet, but the some account owners could lose more than 30 percent of their holdings.

That's why the government also plans to implement "capital controls" preventing people from emptying their bank accounts too soon, another measure that won't go over well for outside investors. (Update: After a week of being totally closed, the banks will re-open tomorrow.)

The other key plank of the deal is that the state-owned Popular Bank of Cyprus, will be divided into two banks: a "good" bank and a "bad" bank, with the goal of slowly shutting down the bad bank and eliminating its worst assets. (Unfortunately, that also means the elimination of thousands of jobs.) The "good" bank will then be folded into the larger Bank of Cyprus in a reorganization plan that would shore up the finances of both institutions, without resorting to a messy bankruptcy. Customers who are losing deposits to the tax will get shares of the new bank as compensation, but are still expected to lose a lot of money.

While the deal is still an ugly mess for the millions, most observers agree that it's making the best of an awful situation. Taking money from bank depositors in order to pay for the failures of the bank's owners remains a controversial proposition, but when the alternative is the bank's total failure. Plus, this plan will be perceived as protecting small investors—who haven't even been able to go into a bank in over a week—at the expense of richer (and mostly foreign) "fat cats" That makes it a lot easier for the public to swallow. It may not be fair, but it's "fairer" than most of the other bad alternatives.