Cyprus has clinched a last-ditch deal with international lenders for a 10 billion euro ($13bn) bailout that will shut down its second largest bank and inflict heavy losses on uninsured depositors, including wealthy Russians.

Final backing was received at around 01:00 GMT on Monday, after marathon talks between President Nicos Anastasiades and heads of the European Union, the European Central Bank and the International Monetary Fund - hours before a deadline to avert a collapse of the banking system.

Deal came after hours of tense talks between Cypriot President Nicos Anastasiades and the 'troika' [Reuters]

The plan, swiftly endorsed by eurozone finance ministers, will spare the east Mediterranean island a financial meltdown by winding down Popular Bank of Cyprus, also known as Laiki, and shifting deposits below 100,000 euros ($129,000) to the Bank of Cyprus to create a "good bank".



Deposits above 100,000 euros, which under EU law are not guaranteed, will be frozen and used to resolve debts, and Laiki will effectively be closed, with thousands of job losses.



An EU spokesman said no levy would be imposed on any deposits in Cypriot banks. A first attempt at a deal last week collapsed when the Cypriot parliament rejected a proposed levy on all deposits.



A senior source involved in the talks said Anastasiades had threatened to resign at one stage if he was pushed too far.



EU diplomats said the president, flown to Brussels in a private jet chartered by the European Commission, had fought to preserve the country's business model as an offshore financial centre drawing huge sums from wealthy Russians and Britons.



"The liabilities paid off and whatever remains will come directly out of the bank accounts of the uninsured depositors," Al Jazeera's Jonah Hull reports from Nicosia.



'Casino economy'



The key issues in dispute were how Cyprus would raise 5.8 billion euros ($7.5bn) from its banking sector towards its own financial rescue, and how to restructure and resolve the outsized banks.



The EU's economic affairs chief Olli Rehn said there were no good options but "only hard choices left" for the latest

casualty of the eurozone crisis.

With banks closed for the last week, the Central Bank of Cyprus imposed a 100-euros ($130) per day limit on withdrawals from cash machines at the two biggest banks to avert a run.



French Finance Minister Pierre Moscovici rejected charges that the EU had brought Cypriots to their knees, saying it was the island's offshore business model that had failed.



"To all those who say that we are strangling an entire people ... Cyprus is a casino economy that was on the brink of bankruptcy," he told Canal Plus television.



The euro gained against the dollar on the news in early Asian trading.



Analysts had said failure to clinch a deal could cause a financial market selloff, but some said the island's small size

- it accounts for just 0.2 percent of the eurozone's economic output - meant contagion would be limited.



The abandoned levy on bank deposits had unsettled investors since it represented an unprecedented step in Europe's handling of a debt crisis that has spread from Greece, to Ireland, Portugal, Spain and Italy.