Cyprus secured a 10 billion euro (£8.5 billion) package of rescue loans in tense negotiations, saving the country from a banking system collapse and bankruptcy.
"We've put an end to the uncertainty that has affected Cyprus and the euro area over the past week," said Jeroen Dijsselbloem, who chairs the meetings of the 17-nation eurozone's finance ministers.
In return for the bailout, Cyprus must drastically shrink its outsized banking sector, cut its budget, implement structural reforms and privatise state assets, he said.
The cash-strapped Mediterranean island nation has been shut out of international markets for almost two years, and needs the bailout to recapitalise its ailing lenders and keep the government afloat.
The European Central Bank (ECB) had threatened to cut crucial emergency assistance to the country's banks by Tuesday without an agreement. So without an agreement by then, the nation of about one million would have faced the prospect of bankruptcy, which could have forced it to become the first country to abandon the euro. That precedent would have disturbed the markets and triggered turmoil across the entire eurozone of 300 million people, analysts said, even though Cyprus only makes up less than 0.2% of the eurozone's 10 trillion (£8.5 trillion) economy.
The finance ministers accepted the plan reached in 10 hours of negotiations in Brussels between Cypriot officials and the so-called troika of creditors - the International Monetary Fund, the European Commission and the ECB. "We believe that this will form a lasting, durable and fully financed solution," said IMF chief Christine Lagarde.
Under the plan, Cyprus' second-largest bank, Laiki, will be restructured and holders of bank deposits of more than 100,000 euro (£85,000) will have to take losses, Mr Dijsselbloem said, adding that it was not yet clear how severe they would be. "This will have to be worked out in the coming weeks," he added, noting that it is expected to yield 4.2 billion euro (£3.5 billion) overall.
Analysts have estimated investors might lose up to 40% of their money. Savers' deposits with all Cypriot banks of up to 100,000 euro will be guaranteed by the state in accordance with the EU's deposit insurance guarantee, Mr Dijsselbloem said.
Laiki will be dissolved immediately into a bad bank containing its uninsured deposits and toxic assets, with the guaranteed deposits being transferred to the nation's biggest lender, Bank of Cyprus. Large deposits with Bank of Cyprus above the insured level will be frozen until it becomes clear whether or to what extent they will also be forced to take losses, the Eurogroup of finance ministers said in a statement.
After the eurozone's finance ministers' approval, several parliaments in eurozone countries such as Germany must also approve the bailout deal, which might take another few weeks. EU officials said they expect the whole programme to be approved by mid-April.