Cyprus has decided to keep the banks in the country closed until Thursday to ensure the "smooth functioning of the whole banking system" after it reached a deal with the Eurozone officials and the International Monetary Fund (IMF) for a bailout fund.

Even after the opening of the banks on Thursday, they will be subject to capital controls to prevent a run on deposits. Cyprus was supposed to open all but the biggest two banks on Tuesday.

The banks have been closed since 15 March on fears of mass withdrawals after a levy on certain Cypriot bank accounts was announced as part of the original €10bn ($13bn/£8.5bn) bailout package.

The original bailout plan that included a one-time levy on almost all the bank accounts was rejected by the country's parliament amid mass protests.

Later, the country presented the lenders with a new plan involving a major restructuring of the country's banking system, while keeping the one-time levy only on large deposits.

Under the new plan, Cyprus agreed to close down its second-largest bank, The Popular Bank of Cyprus - also known as Laiki - passing heavy losses on big depositors, many of them Russian, and cutting thousands of jobs.

"The agreement we reached is difficult but, under the circumstances, the best that we could achieve," Cypriot President Nicos Anastasiades said.

"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."

Speaking about the future capital controls in banks, Anastasiades noted that they will be a temporary measure and will be relaxed gradually.

Without the bailout agreement, the country's banking system would have collapsed with the European Central Banking stopping its assistance to the banks. That would have resulted in Cyprus being the first country to move out of the eurozone.

From the winding up of Laiki Bank, the country is expected to raise €4.2bn of the €5.8bn contribution required by the EU and IMF to secure the bailout.

Cyprus is due to repay a €1.42bn bond on 3 June, and therefore it has to secure the bailout fund by then.