Agreement set to involve heavy losses for wealthy investors, while those with savings under €100,000 will be spared

European leaders reached an agreement with Cyprus early on Monday morning that closes down the island's second-biggest bank and inflicts huge losses on wealthy savers.

Russians would lose billions of euros under draconian terms that are aimed at preventing the Mediterranean tax haven becoming the first country forced out of the single currency.

"Herman Van Rompuy has brokered an agreement between the troika and Cyprus," said an EU source, referring to the president of the European council and Cyprus's trio of creditors: the European commission, the European Central Bank and the International Monetary Fund.

A meeting of eurozone finance ministers that started six hours late reached an agreement in the early hours of Monday morning to finalise the fine print of the deal. Savers with deposits of less than €100,000 (£85,000) would be spared but it was thought there would be heavy losses inflicted on the deposits of the wealthy.

Laiki, or Cyprus Popular Bank, is to be closed, with its good assets transferred to Bank of Cyprus, the country's biggest bank, where savers would suffer big losses in return for equity shares. Those with more than €100,000 in Laiki would also be hit hard.

Negotiations got under way amid a hardening of the stance by the IMF and Germany, which insisted that depositors must take the hit for bailing out the eurozone's latest crisis economy.

There were signs of panic in Cyprus as a €100 limit was imposed on ATM withdrawals, with more stringent capital controls to follow if the deal is finalised.

The European Central Bank had threatened to cut off funds propping up Cypriot banks on Monday, which would have precipitated the island's exit from the euro if agreement was not reached at the emergency meeting.

"The numbers have not changed. If anything they've got worse," said Wolfgang Schäuble, Germany's finance minister. He said the aims of last week's agreement to raise €5.8bn – details of which were rejected by Cyprus – had to be achieved. This time, however, savers with less than €100,000 will be spared, meaning the burden falls much more heavily on the wealthy than the 9.9% levy proposed last week for their accounts.

Germany is determined that the island deflate a bloated financial sector that exceeds the size of the Cypriot economy by a factor of seven.

"It is well known that I won't allow myself to be blackmailed by no one or nothing," said Schäuble. "I'm aware of my responsibility for the stability of the euro. If we take the wrong decisions we'll be doing the euro a great disservice," he told a German Sunday newspaper.

Russians are estimated to hold more than €20bn of the €68bn deposited in Cypriot banks. Bank of Cyprus holds €28bn in deposits although it was not clear how much of that would qualify for the "haircut". But it was clear that the losses would amount to several billion.

The Cypriot president, Nicos Anastasiades, held meetings with EU officials in Brussels before the meeting of the euro group – the 17 finance ministers of the single-currency area – which included troika representatives Christine Lagarde, head of the IMF, Mario Draghi, president of the ECB, and Olli Rehn, European commissioner for economic and monetary affairs.

Little progress was reported from the earlier meetings on resolving the stalemate over how to structure a €17bn bailout, with creditors unwilling to offer more than €10bn while expressing dissatisfaction with Cypriot proposals to supply the remainder.

The agreement outlined early on Monday came close to what Lagarde had demanded a week ago and which had been rebuffed by Anastasiades.

Over the weekend Nicosia moved on legislation to wind up Cyprus Popular Bank and introduce capital controls to try to prevent a bank run and the flight of money out of the country.