Cyprus has secured a £8.5 billion (10 billion euro) package of rescue loans in heated negotiations this morning, saving the country from financial collapse and helping to push Asian stock markets higher.
"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.
Depending on the deal's details, "the outcome will mean that the risks of Cyprus defaulting and leaving the euro zone will have significantly diminished," said analysts at Credit Agricole CIB in Hong Kong in a market commentary.
Japan's Nikkei 225 index surged 1.9% to 12,567.07. Australia's S&P 500 added 0.5% to 4,993.20. South Korea's Kospi jumped 1.4% to 1,975.33. Stocks in mainland China fell.
Hong Kong's Hang Seng rose 0.7% to 22,272.68, although trading volume was somewhat thin.
Linus Yip, strategist at First Shanghai Securities in Hong Kong, said the market was being cautious ahead of the release of earnings from the Industrial and Commercial Bank of China, the Agricultural Bank of China and Bank of China this week.
"Chinese banking players will report, so the market is maybe taking a wait-and-see attitude," he said.
Banking shares in other markets posted strong gains, evidence of relief amid the financial sector for the Cyprus bailout.
South Korea's Shinhan Financial Group jumped 5.3%. Japan's Nomura Holdings advanced 1.9%. Australia's Westpac Banking Corp. added 1.7%.
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 tomorrow without an agreement.
So without an agreement by tonight, the nation of about 1one 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.
Mr Dijsselbloem defended the creditors' approach to make deposit holders take heavy losses, saying the measures "will be concentrated where the problems are, in the large banks".
The international creditors, led by the IMF, were seeking a fundamental restructuring of the outsized financial system, which is worth up to eight times the country's gross domestic product of about 18 billion euro (£15.2 billion).
They said the country's business model of attracting foreign investors, among them many Russians, with low taxes and lax financial regulation has backfired and must be reformed.
For Cyprus, the drastic shrinking of its financial sector, the loss of confidence with the recent turmoil and the upcoming austerity measures means that the country is facing tough times.
"The near future will be very difficult for the country and its people," acknowledged the Commission's top economic official Olli Rehn.
"But (the measures) will be necessary for the Cypriot people to rebuild their economy on a new basis."
To secure a rescue loan package, Nicosia had to find ways to raise several billion euro so it could qualify for the 10 billion euro bailout package.
The bulk of that money is now being raised by forcing losses on large deposit holders, with the remainder coming from tax increases and privatisations.
The creditors had insisted that Cyprus could not receive more loans because that would make its debt burden unsustainably high.
A plan agreed to in marathon negotiations earlier this month called for a one-off levy on all bank depositors in Cypriot banks.
But the proposal sparked fierce anger among Cypriots because it also targeted small savers, and failed to win a single vote in the Cypriot Parliament.
In an illustration of the depth of the fear of a banking collapse, Cyprus' central bank yesterday imposed a daily withdrawal limit of 100 euro (£85) from ATMs of the country's two largest banks to prevent a bank run by depositors worried about their savings.
Cypriot banks have been closed for the past week while officials worked on a rescue plan, and they are not due to reopen until tomorrow. Cash has been available through ATMs, but long queues formed and many machines have quickly run out of cash.
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.