BRUSSELS--The European Union has ordered Starbucks Corp. and Fiat Chrysler Automobiles to pay back tens of millions of euros in unpaid taxes obtained through illegal tax deals, in an unprecedented decision by regulators that risks blowing open thousands of corporate tax structures across Europe.

The European Commission, the EU's executive arm, said Wednesday that tax deals granted to Starbucks in the Netherlands and Fiat in Luxembourg amounted to illegal state subsidies that must be repaid.

The commission ordered Luxembourg and the Netherlands to recover the unpaid tax from Fiat and Starbucks, which it said amounts to EUR20 million to EUR30 million ($22.6 million to $34 million) for each company. The companies can no longer continue to benefit from the advantageous tax treatment granted by these tax rulings, the commission said.

The two tax deals "endorsed artificial and complex methods to establish taxable profits for the companies" that "do not reflect economic reality, " the commission said in a statement.

As a result of the deals, most of the profits of Starbucks' Dutch coffee-roasting company "are shifted abroad, where they are also not taxed," while Fiat's financing company in Luxembourg "only paid taxes on underestimated profits," the commission said.

Wednesday's decision, wrapping up two of five tax investigations opened by EU regulators in recent months, casts a pall of uncertainty over potentially thousands of similar tax deals struck by multinationals across Europe.

"Thousands of other companies risk seeing their tax arrangements re-examined," said Chris Bryant, partner at international law firm Berwin Leighton Paisner. "Billions of euros could be at stake."

EU regulators are working on three similar investigations involving Apple Inc. in Ireland and Amazon.com Inc. in Luxembourg, as well as a Belgian tax discount for a number of multinationals including AB InBev. It isn't yet clear when those cases will be decided. All companies have denied receiving special treatment, and the governments have denied giving it.

Write to Tom Fairless at tom.fairless@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires