The much controversial decision is legal. Cyprus, one of the 17 nations world-wide that uses the euro currency, can lower or raise any tax it wants at any given point in time.
Now everyone who wants to withdraw his/her money from a Cyprus bank account has to pay a tax that can be as high as 9.9%. For deposits smaller than 100000 euro the tax is 6.75%.
This is not the first time depositors suffered in European countries. Some other countries taxed bank deposits in the past too. One example is Italy which had a similar tax in the 1990s.
Right now Cyprus is struggling with its economic/financial situation. The International Monetary Fund and Cyprus’ European partners gave the country 10 billion euro to help. The island nation thus had a chance to avoid bankruptcy but only be enforcing harsher changes such as this recently introduced tax.