An 11th-hour deal with the EU, which has saved the Cypriot economy from the brink, will see investors with more than €100,000 in the nation’s largest banks forfeit a large chunk of their deposits.

The punishing deal – which has been approved by the eurozone finance ministers – will allow the country to receive the €10bn (£8.5bn) bailout it needed before the European Central Bank pulled funding and sent the island on the path to bankruptcy and a possible exit from the single currency.

Under the new agreement, all bank deposits under €100,000 will be secured and guaranteed by the state. The country's second-biggest bank, The Popular Bank of Cyprus – known as Laiki – will be closed whilst holders of deposits of more than €100,000 face big losses.

Download the new Independent Premium app Sharing the full story, not just the headlines

Laiki will be split into good and bad banks, with its healthy assets eventually absorbed into Bank of Cyprus.

The Eurogroup said in a statement: “The programme will address the exceptional challenges that Cyprus is facing and restore the viability of the financial sector, with the view of restoring sustainable growth and sound public finances over the coming years.

“The Eurogroup further welcomes the Cypriot authorities' commitment to take further measures. These measures include the increase of the withholding tax on capital income and of the statutory corporate income tax rate. The Eurogroup looks forward to an agreement between Cyprus and the Russian Federation on a financial contribution.”

The president of the Eurogroup of eurozone finance ministers, Jeroen Dijsselbloem, said in a press conference in Brussels that the new deal is better than last week’s proposal because it concentrates on the country's two major banks and that the agreement had “put an end to the uncertainty” around Cyprus' economy.

"I would l like to emphasis that none of these measures will affect deposits below €100,000," he added.

Meanwhile, a powerful firecracker has been detonated inside a branch in the country's largest lender, the Bank of Cyprus. Cyprus News Agency quoted police sources as saying the explosion late caused some damage to the branch in Limassol. According to the report, two people smashed a glass door and set off the firecracker but firefighters quickly extinguished the flames.

Sparks flew at the negotiations between President Nicos Anastasiades and the “troika” of the International Monetary Fund (IMF), EU and ECB, with the President at one point threatening to resign as troika officials pressed him to wind down two bloated banks.

Daily coronavirus briefing No hype, just the advice and analysis you need Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive morning headlines Monday - Friday plus breaking news alerts by email Update newsletter preferences

Cyprus was asked to raise a €5.8bn contribution to the nearly €17bn it needed to stay afloat, but had been resisting IMF pressure to radically restructure two of their biggest lenders, which were saddled with billions of euros in debt by the crisis in Greece.

The Central Bank of Cyprus moved to stop large withdrawals from those two lenders, imposing a €100 daily withdrawal limit at their cash machines.

There are fears that Cypriots will race to the banks when they reopen tomorrow and money will flood out of the country.

Moscow also reacted with anger today to the bailout of Cyprus that will result in heavy losses for foreign depositors at the Mediterranean island's banks, many of which are Russian.

"The stealing of what has already been stolen continues," Prime Minister Dmitry Medvedev was quoted by news agencies as telling a meeting of government officials.

Cypriot MPs had last week voted down a bill requiring all account-holders to forfeit a percentage of their savings. But as the days passed and the nation inched closer to bankruptcy, the Finance Minister performed a U-turn and said the levy was back on the negotiating table. Eurozone finance ministers and the IMF had refused to budge on their demand that Cyprus should come up with €5.8bn to qualify it for €10bn in assistance. The German Finance Minister, Wolfgang Schäuble, said: “We haven’t got much further in the last week. The numbers have not changed; if anything they have worsened.” Asked what new solution there could be, he replied: “What we agreed last week.”

His Austrian counterpart, Maria Fekter, said: “The ECB cannot just provide drawn-out euthanasia for the ailing banks. Therefore it is necessary that stable reforms are carried out.”

Eurozone states, led by Germany, say Cyprus’s current status as an offshore banking haven popular with Russian investors was simply not sustainable. The bloc is also desperate to stop the turmoil in Cyprus spilling over into other eurozone nations, and there has been open talk among officials that the Mediterranean island could be sacrificed to save the single currency.

The ECB had been propping up the crippled banks, but had threatened to pull the funding today is Cyprus was unable to reach a deal with the troika.

The island of 860,000 people accounts for only 0.2 per cent of eurozone GDP, but if there is a run on the banks – if they reopen as scheduled tomorrow – delicate investor confidence in other eurozone states could be shattered, causing a wider flight of capital from the eurozone.