With about half of parliament abstaining from the vote, others pass a formula to keep money funneling in from the European Central Bank.

ATHENS — Racing against time and short on choices, Cyprus lawmakers on Friday made an abrupt about-face, agreeing to emergency legislation as part of yet another bailout formula cobbled together to secure a $13-billion lifeline to keep its weak banks afloat and avert a devastating default.

After 25 members of Cyprus' parliament abstained from voting, two voted against the plan and one walked out, 26 lawmakers approved the creation of a national solidarity fund to manage state assets, including public and private pension funds. Legislators also decided to restructure ailing banks and impose controls that would lock down deposits and prevent a run on the nation's troubled financial sector.

According to an ultimatum issued this week, failure to produce a viable bailout scheme by Monday would force the European Central Bank to stop funneling billions of dollars into Cyprus' cash-strapped financial system, leaving the tiny island to fend for itself.

Although its small economy accounts for only 0.2% of economic output among the 17 nations that use the euro, the ripple effect of letting Cyprus go under could cause a financial catastrophe, analysts fear.

Cyprus lawmakers have been seeking alternative funding formulas since the European Union and the International Monetary Fund proposed that ordinary Cypriots assist with the rescue plan through a levy of up to 10% on bank deposits, a move that would have raised $7.5 billion of the $20-billion bailout. That deal backfired when parliament rejected it this week.

By Friday, though, lawmakers again focused on a savings tax in a desperate bid to win back the support of its international lenders. President Nicos Anastasiades held back-to-back meetings with EU, IMF and European Central Bank representatives on the island, putting the finishing touches on a compromise deal.

The most contentious part of the plan — the savings tax — remained to be debated Saturday. State media suggested Anastasiades would fine-tune the final terms with lenders in weekend talks in Brussels.

"It will be a difficult decision," government spokesman Christos Stylianides told reporters before the vote. "The plan features some painful elements, but the country has to be saved."

He did not elaborate. But the government's acquiescence to Europe's initial demands illustrated the desperation in Cyprus, especially when an earlier flurry of diplomatic initiatives to lure financial help from Moscow failed.

After two days of crisis talks with his Russian counterpart, Cyprus Finance Minister Michalis Sarris returned to Nicosia, the capital, on Friday, publicly conceding that neither the Kremlin nor Russian investors were interested in "any of the offers made."

Details of the new deal have yet to be officially disclosed but, according to various sources, a savings tax of 1% was set to be imposed on all bank accounts. It remained unclear whether a 17% tax would be levied on deposits over $130,000.

Hundreds of angry Cypriots had gathered outside the nation's parliament to protest the revamped bailout plan. Other locals, though, lined up to withdraw deposits before the vote.

"If this proves uncontrollable and unsustainable, Cyprus may go up in flames, singeing Spain and Italy," said Alexander Apostolides, a leading economic analyst in Nicosia. "Germany, though, controlling events here and in the rest of the single-currency zone, will be left at best with a sunburn."