Cyprus's parliament has approved a European Union bailout including provisions to impose substantial losses on bank depositors and wind down one of the island's biggest banks.
By a show of hands, 29 politicians approved ratification of the bailout bill and 27 opposed.
The government had warned that without approval the economy was in imminent danger of default.
Cyprus is expected to get the first disbursement of a total of €10 billion in aid from the European Union and the International Monetary Fund next month.
Cyprus, the eurozone's third smallest country, is bracing itself for at least two years of economic misery and record unemployment as terms of the €10bn bailout deal begin to take effect.
Attempts to agree on a bailout triggered financial chaos on the island last month, when parliament rejected an initial plan to force both insured and uninsured depositors to pay a levy to fund the recapitalisation of two banks heavily exposed to debt-crippled Greece.
Insured deposits are those of up to €100,000.
It was followed by a two-week shutdown of banks.
The fallback option was to wind down one of the banks, Laiki, and impose losses of up to 60% on uninsured deposits in a second, Bank of Cyprus.