If the ruling is followed, airlines will be forced from next year to pay for their carbon emissions on all flights to and from, as well as within, Europe.

Sarah Burt, staff attorney at the campaigning organisation Earthjustice, said: "In the absence of an effective global measure for reining in greenhouse gases from aviation, the EU law is a necessary step to address this significant and rapidly expanding source of pollution. We are pleased that the advocate general's opinion confirms the legality of this important action."

The UK's climate change minister, Greg Barker, said: "We welcome today's legal opinion. The UK and EU will continue to robustly defend our policy to bring aviation into the EU's emissions trading system and believe it is consistent with international law. The aviation industry, in the same way as other industries, needs to play its part in reducing emissions."

If successful, Europe's move to include international flights in its emissions trading system will be the first time that emissions from flights – which make up about 2 to 3% of global greenhouse gases – have been regulated. Aviation and maritime transport were explicitly excluded from the 1997 Kyoto protocol, the only international binding treaty on emissions reduction.

Air industry bodies that helped bring the case to court vowed to fight on. The Air Transport Association said: "[We are] disappointed that Advocate General Kokott does not believe that the European Union is bound by the Chicago Convention, the treaty governing aviation, and that the unilateral application of the EU [emissions trading sytem] to international aviation otherwise does not violate law. ATA's view that the extension of this unilateral, regional scheme to aviation violates international law is supported by more than 20 countries, including Brazil, Russia, India, China, Japan, the United States and many others, which recently reconfirmed their opposition to the EU."

Under the EU's plans, all flights to, from and within Europe will be subject to emissions trading, a system whereby companies must have permits to cover the carbon dioxide they produce. A small number of permits are allocated to companies for free, while the rest must be paid for, and the proportion of free permits is reduced over time. At present, the permits are changing hands for about €14 per tonne on the open market.

The trading system will add to airlines' costs, at a level of as much as €5-10 per passenger, according to some estimates. All of the costs are likely to be passed on to passengers, raising ticket prices.

Thursday's ruling – an indicative and preliminary finding by one senior judge – was a severe setback to their legal challenges, but is not the end. The governments, and airlines, will continue to fight against the EU in the courts and explore other options.

The ATA said: "Today's action is an important step in the court process, but as it is a non-binding preliminary opinion it does not mark the end of this case. The opinion will provide a basis on which the judges assigned to the case can further deliberate and come to a full and unanimous decision. In complex cases such as this one, it would not be unusual for the full court's final opinion to vary from the preliminary opinion."

Outside the international legal system, however, the opportunities for airlines are limited, as mooted alternatives such as stopping or refuelling outside the EU in order to avoid the charge are likely to cost more than paying it. Analysts also regard it as extremely unlikely that the cost of trading permits will diminish the number of flights into and out of Europe.

Governments such as the US have argued that the International Civil Aviation Organisation should be in charge of reducing emissions from international aviation. ICAO has discussed ways of cutting emissions from aviation for most of the last decade. It has yet to come forward with binding plans that would reduce emissions.

In his legal opinion, the advocate general said: "The EU institutions could not reasonably be required to give the ICAO bodies unlimited time in which to develop a multilateral solution."

Annie Petsonk, international counsel at the US-based Environmental Defense Fund, said: "Airlines operate in a global market, and the reality is that those markets will be increasingly carbon-constrained. It's time for the US airlines to provide leadership and demonstrate that we can compete in the carbon-limited markets of the 21st century. No lawsuit will stop climate change or its effects, so it's time to move forward and implement the solutions already available: Europe's aviation directive."

Richard Dyer, transport campaigner at Friends of the Earth, urged governments to spend more time considering lower carbon forms of transport. He said: "The aviation industry has consistently opposed measures to protect our economy and our environment from global warming – the EU must stand firm and force the sector to play its part. Governments must also take action to make alternatives to short-haul flights, such as making long-distance rail travel cheaper and easier to use."