The European Union's highest court ruled on Wednesday that the EU can make all airlines flying to or from European airports pay to offset their carbon emissions from January 1.

The European Court of Justice ruled that the EU was entitled to oblige all airlines flying to or from Europe to pay.

The directive including aviation activities in the EU's emissions trading scheme is valid, the court said in a statement.

Application of the emissions trading scheme to aviation infringes neither the principles of customary international law at issue nor the open-skies agreement, it said.

The case before the court has triggered hostile reaction from airlines around the world, as well as blocking legislation in the U.S. Congress and a threat from U.S. Secretary of State Hillary Clinton.

The ruling by the court's judges was in line with a preliminary opinion delivered in October by ECJ Advocate General Juliane Kokott, in which she said EU legislation did not infringe the sovereignty of other states and was compatible with the relevant international agreements.

(Reporting by Michele Sinner)