The president of Cyprus assured his people a bailout deal he struck with the European Union was in their best interests and would end anxiety, but he also announced "very temporary" capital controls to stem a run on the island's banks.

Returning from fraught overnight negotiations in Brussels, President Nicos Anastasiades said the €10 billion rescue plan agreed there in the early hours of the morning was "painful" but essential to avoid economic meltdown.

He has agreed to close down the second-largest bank, Cyprus Popular, and inflict heavy losses on big depositors, many of them Russian, after Cyprus's outsize financial sector ran into trouble when its investments in neighbouring Greece went sour.

"The agreement we reached is difficult but, under the circumstances, the best that we could achieve," Mr Anastasiades said in a televised address to the nation.

"We leave behind the uncertainty and anxiety that we all lived through over the last few months and we look forward now to the future with optimism," he told compatriots who face an immediate deep recession and years of economic hardship.

Many Cypriots say they feel anything but reassured by the bailout deal, however, and fear of banks being besieged when they reopen after being shut all last week saw plans for their reopening put back until Thursday.

Little is known about the restrictions on bank transactions that Mr Anastasiades said the central bank would impose, but he told Cypriots: "I want to assure you that this will be a very temporary measure that will gradually be relaxed."

Capital controls, preventing people moving funds out of the country, are at odds with the European Union's ideals of a common market but the government may fear an ebb tide of panic that would cause even more disruption to the economy.

Without an agreement by the end of Monday, Cyprus had faced certain banking collapse and risked becoming the first country to be pushed out of the European single currency - a fate that Germany and other northern creditors seemed willing to inflict on a nation that accounts for just a tiny fraction of the euro economy and whose banks they believed had suffered fatal hubris.

Backed by eurozone finance ministers, the plan will wind down the largely state-owned Cyprus Popular Bank, known as Laiki, and shift deposits under €100,000 to the Bank of Cyprus to create a "good bank", leaving problems behind in, effectively, a "bad bank".

Deposits above €100,000 in both banks, which are not guaranteed by the state under EU law, will be frozen and used to resolve Laiki's debts and recapitalise the Bank of Cyprus, the island's biggest, through a deposit/equity conversion.

The raid on uninsured Laiki depositors is expected to raise €4.2 billion of the €5.8 billion the EU and IMF had told Cyprus to raise as a contribution to the bailout, Dutch Finance Minister Jeroen Dijssebloem said.

Cyprus government spokesman Christos Stylianides told state radio that losses on uninsured depositors would be "under or around 30%".

Laiki will effectively be shuttered, with thousands of job losses.

Officials said senior bondholders in Laiki would be wiped out and those in Bank of Cyprus would have to make a contribution - setting a precedent for the eurozone.

Dijsselbloem's comments on the need for lenders to banks to accept the potential risks of their failure had a knock-on effect in the eurozone, raising the cost of insuring holdings of bonds issued by other banks, notably in Italy and Spain.

Global equity markets and the euro retreated on his comment that the Cyprus bailout could be a template for solving other problems, by shifting more risk to depositors and stakeholders.

A first attempt at a deal last week collapsed when the Cypriot parliament rejected a proposed levy on all deposits, large and small. That proposal outraged ordinary Cypriots, leading to queues at bank cash machines.

The central bank has imposed a €100 daily limit on withdrawals from ATMs at the two biggest banks to avert a run.

Russia signalled it would back the bailout even though it would impose big losses on Russian depositors, who by some estimates may hold a third of all deposits in Cypriot banks.

President Vladimir Putin ordered officials to restructure a loan Moscow granted to Cyprus in 2011 - having rejected Nicosia's request for easier terms in crisis talks last week.

Prime Minister Dmitry Medvedev, who ranks below Putin, earlier criticised the bailout, voiced the anger expressed by Russian depositors, saying: "The stealing of what has already been stolen continues."

Comprehensive and credible plan - IMF chief

IMF Chief Christine Lagarde said the agreement was "a comprehensive and credible plan" that addresses the core problem of the banking system.

"This agreement provides the basis for restoring trust in the banking system, which is key to supporting growth," she said in a statement.

With banks closed for the last week, the Central Bank of Cyprus imposed a €100 per day limit on withdrawals from cash machines at the two biggest banks to avert a run.

French Finance Minister Pierre Moscovici rejected charges that the EU had brought Cypriots to their knees, saying it was the island's offshore business model that had failed.

"To all those who say that we are strangling an entire people ... Cyprus is a casino economy that was on the brink of bankruptcy," he said.

The euro gained against the dollar on the news in early Asian trading.

Analysts had said failure to clinch a deal could cause a financial market selloff.

However, some said the island's small size, which accounts for just 0.2% of the eurozone's economic output, meant contagion would be limited.

The abandoned plan for a levy on bank deposits had unsettled investors since it represented an unprecedented step in Europe's handling of a debt crisis that has spread from Greece, to Ireland, Portugal, Spain and Italy.