The towers of the European Court of Justice are seen in Luxembourg, January 26, 2017. Picture taken January 26, 2017. REUTERS/Francois Lenoir

BRUSSELS (Reuters) - Germany acted legally when it exempted heavy industry from a green energy surcharge in 2012, the European Union’s top court said on Thursday, overturning a decision by the EU antitrust regulator and annulling EU orders to recover the aid.

The European Commission, which is responsible for competition policy, had ordered Germany in 2014 to recoup some of the multi-billion euro reductions on the green surcharge it granted in 2013 and 2014 to some 2,000 heavy energy users.

They include chemical giant BASF and steelmaker ThyssenKrupp.

The Commission’s decision was backed by the EU general court in a ruling in 2016. But the European Court of Justice on Thursday overturned that verdict, saying Brussels had not proved the exemptions offered were illegal state aid.

Reacting to the ruling, a Commission spokesman said the EU executive would assess the judgment and that the recovery orders for the discounts granted had “lost their legal basis”.

He also said the judgment did not necessarily imply Germany’s current charge exemptions, introduced after the 2012 provisions expired, were compliant with EU state aid rules.

Seven years ago, Germany imposed levies on power bills to subsidize the development of renewable sources such as wind turbines and solar panels, but exempted from the surcharge firms that were heavy users of energy, such as aluminum or copper, to avoid affecting their competitiveness.

The EU Commission said this was illegal state aid and ordered a partial recovery of the discount granted to those firms, which in total was estimated at about 5 billion euros ($5.6 billion).

But the EU top court said the commission failed to establish that the advantages provided by the 2012 German law were illegal state aid. It also said the EU court of first instance “was wrong” when in 2016 it stated that those subsidies were illegal.