The European Union’s top court ruled on Tuesday that junior creditors and investors need not necessarily suffer losses before a bank is rescued, a judgment that may work in Italy’s favor as it seeks to bail out its banks.

The ruling, which follows action by disgruntled investors whose savings were wiped out by a bank rescue in Slovenia, is crucial in understanding how new EU rules to impose such losses are rolled out across the region.

The so-called bail-in regime, adopted after the financial crash, forces losses on private investors before banks can be rescued by the state — in order to spare the taxpayer.

While the judges in Luxembourg made clear that imposing such losses was legally sound, they appeared not to require that this happen automatically.

Reuters