(BRUSSELS) - The European Union's highest court ruled in Germany's favour on Tuesday, finding that a controversial law protecting auto giant VW from hostile takeovers does not breach EU competition rules.

The European Commission, the EU's executive arm, took Germany to the European Court of Justice in 2011 for failing to obey in full a 2007 judgement and repeal all the legislation.

The ECJ found Tuesday that "Germany has met its obligations arising from the 2007 ruling" on Volkswagen, Europe's biggest automaker.

The 1960 law on the privatisation of Volkswagen gave German public authorities special powers over the company, with 20-percent stakes going to the federal government and the northwestern region of Lower Saxony, VW's home base.

After the 2007 court ruling, Germany abolished parts of the law, including board seats for public authorities and a 20 percent voting cap irregardless of how much a shareholder actually owned.

The Commission charged, however, that Berlin had failed to remove the provision which gave Lower Saxony the 20 percent blocking stake and so took Germany back to the ECJ.

Germany argued that this provision on its own did not contravene EU rules and the ECJ agreed with this understanding in its ruling on Tuesday.

The 2007 ruling was based on the view that all three provisions working together were an infringement of EU rules, an ECJ statement said.

The Commission said the ruling marked the end of the matter.

"It brings clarification after long litigation ... and brings the matter to a close; the issue is finished," a spokeswoman said.

Judgement of the European Court of Justice in Case C-95/12 - Commission v Germany