A big trade ruling in the long battle between Airbus and Boeing left both sides cheering.

The World Trade Organization said Tuesday that the European Union helped Airbus with unfair subsidies that hurt sales of Boeing's wide-body jets.

But the organization also overturned a previous ruling that found the subsidies were hurting sales of the single-aisle 737, Boeing's most popular plane.

US Trade Representative Robert Lighthizer said the decision "confirms once and for all that the EU has long ignored WTO rules, and even worse, EU aircraft subsidies have cost American aerospace companies tens of billions of dollars in lost revenue."

He said that the United States would impose tariffs if the EU doesn't follow international trade laws. That would be an escalation at a time when US relations with trading partners are already tense. But the European Union said it planned to take "swift action" to align with the WTO's recommendations.

The rivals are in fierce competition for plane orders. Airbus booked more orders last year, but Boeing delivered more planes.

"This is a high-stakes battle," Douglas Holtz-Eakin, president of the American Action Forum, told Richard Quest on CNN's "Quest Means Business" on Tuesday. As airlines expand into the Middle East and China, both companies will be vying for new business, he said.

The fight dates to 2004, when EU authorities said Boeing (BA) received $19 billion in unfair subsidies from federal and state governments between 1989 and 2006. The US government filed a similar claim that year over European subsidies to Airbus (EADSF).

Since then, the WTO has handed down rulings in favor of both sides. It still has to decide whether Boeing received unfair subsidies from Washington state. Airbus contends that Boeing received more than $20 billion in unfair funds from the United States.

Related: Boeing tax package ruled illegal by WTO

Boeing argues that the European Union has granted Airbus more than $22 billion in illegal subsidies. That figure includes the many subsidies that the WTO said were lawful.

"Today's final ruling sends a clear message: disregard for the rules and illegal subsidies is not tolerated," said CEO Dennis Muilenburg.

Both Airbus and the European Union cast the decision as a blow to Boeing.

"The WTO has now dismissed in their entirety 94% of Boeing's original claims," Airbus said in a statement. The company added that it plans to eliminate the subsidies that the WTO ruled were unfair.

EU Trade Commissioner Cecilia Malmström said the WTO "has definitively rejected the US challenge on the bulk of EU support to Airbus."

Related: Airbus wins sales race with Boeing for 5th straight year

Errol Mendes, a professor of international business law at the University of Ottawa, called the decision a "historic ruling at a historic time."

Mendes explained that the Trump administration's support for the ruling is at odds with its own attempts to unravel the WTO — and could put it in a difficult place if the WTO rules against Boeing in the next case.