The European Union's top court has ruled that the EU unfairly froze the funds of Iran's Bank Mellat for six years when it claimed the bank was backing the Islamic Republic's nuclear and missile programs.

The European Court of Justice said Thursday that it rejected the logic tying the bank to the programs and dismissed an EU appeal to have the sanctions upheld.

It said that "since all the measures concerning Bank Mellat have been annulled, its funds are deemed not to have been frozen" between 2010 and last month.

The EU lifted the freeze in January as part of an international agreement over Iran's nuclear program.

Bank Mellat's lawyers believe the ruling has major implications for legal action it could take over losses and damage to its reputation.