Eurozone finance ministers have agreed a deal on a 10bn-euro bailout for Cyprus to prevent its banking system collapsing and keep the country in the eurozone.
Laiki (Popular) Bank - the country's second-biggest - will be wound down and holders of deposits of more than 100,000 euros will face big losses.
However, all deposits under 100,000 euros will be "fully guaranteed".
The European Central Bank had set a deadline of Monday for a deal.
Laiki will be split into "good" and "bad" banks, with its good assets eventually merged into Bank of Cyprus.
The president of the Eurogroup of eurozone finance ministers, Jeroen Dijsselbloem, told a press conference in Brussels the deal had "put an end to the uncertainty" around Cyprus's economy.
He added he was "convinced" the new deal was better for the Cypriot people than the broader measure rejected by the Cypriot parliament last week, as it focused on two problem banks rather than the entire sector.
All deposits under 100,000 euros will be secured. But for those with deposits of more than that amount in the country's two biggest banks - Laiki and Bank of Cyprus - the deal will come as a bitter blow, our correspondent says.
The percentage to be levied on large deposits in the Bank of Cyprus will be resolved in the coming weeks, Mr Dijsselbloem said.
One key element of the deposit tax, demanded by the IMF, is that it not require a parliamentary vote.