NICOSIA, Cyprus (AP) -- Cyprus' president said Saturday that the decision to force bank depositors to share the burden of a €10 billion ($13 billion) bailout package from its European partners and the International Monetary Fund was done to save his country from financial ruin.

Despite that assurance, nervous depositors rushed to ATM machines in Cyprus on Saturday to drain their accounts.

President Nicos Anastasiades said Cyprus had little option but to accept the bailout deal, which imposes a levy on the country's bank deposits -- an unprecedented step in the eurozone crisis. Without it, he said, Cyprus' banking system would have collapsed on Tuesday.

Anastasiades said that's when the European Central Bank would have stopped providing emergency funding to Cyprus' troubled banks. Such a collapse would have driven the country to bankruptcy and possibly out of the eurozone, he said.

The president said the deposit levy rescues banks, keeps the country's debt load manageable, and avoids the risk of deeper pay cuts and tax hikes.

"We're not aiming to gloss over the situation," he said in his first public statement after the EU-IMF meeting in Brussels agreed on the bailout early Saturday. "The solution taken may be painful, but it was the only one" worth taking.

News of the levy stunned the public because Anastasiades and his top ministers had vehemently rejected any suggestions of going after deposits to save Cyprus' banks that lost billions on bad Greek debt.

Lines formed at many ATMs as people scrambled to pull as much of their money out as they could, a development that Cypriot and European officials feared would happen. Another key concern was that the bailout would buckle investor confidence in Cyprus and other weaker eurozone economies.

Trying to head off a full-blown bank run when banks reopen on Tuesday after the long holiday weekend, Bank of Cyprus Group chief Andreas Artemis called for "calm and a level-headed assessment" of the situation.

"Developments are painful and startling. That's why the public's concern is completely understandable and justified," he said.

The levy is expected to raise €5.8 billion.

European officials said people with less than €100,000 in their accounts will have to pay a one-time tax of 6.75 percent, those owning more money will lose 9.9 percent. Cypriot bank officials said that depositors can access all their money, except the amount set by the levy.

Details of how the levy would be implemented remain sketchy. For instance, it's unclear how joint bank accounts would be calculated.

Germany's Finance Minister Wolfgang Schaeuble called the levy part of the "fair" distribution of the bailout's burden. "The Cypriot banking sector will be significantly reduced to a sustainable level and business model," he said.

The Cypriot bailout still needs parliamentary approval by euro area countries, and Schaeuble said it will be brought before the German parliament in the second half of April.

But Cypriots continued to withdraw cash from ATMs until the machines ran out on Saturday, unsure what or how much would be taxed. The country's cooperative banks also shut their doors after depositors scurried in hopes of protecting their savings.

Christos Demetriades, 58, who milled outside a closed Nicosia cooperative bank branch, said: "Politicians and senior bank bosses have covered each other's backs for years. Now it's ordinary people who are paying the price and are being punished."

One disgruntled customer at a branch in the southern coastal town of Limassol briefly parked his tractor in front of its shut doors in a show of frustration.

Spain's economic ministry said Saturday that the Cyprus deal would not set a pattern for other countries. "This is a specific agreement for Cyprus, with its complex situation and an oversized banking sector, a ministry statement said. "Because of this, Cyprus' situation and this agreement are not transferrable to any other country in the eurozone."

Cypriot lawmakers are scheduled to vote on the levy on Sunday in what is likely to be a stormy session in Parliament.