Apple has been told to pay €13bn (£11bn; $14bn) in unpaid taxes to Ireland by the European Court of Justice (ECJ).
The European Commission accused Ireland of giving Apple illegal tax advantages eight years ago but the Irish government has consistently argued against the need for the tax to be paid.
The ECJ said its decision on the matter was final and that “Ireland granted Apple unlawful aid which Ireland is required to recover”.
The Irish government said it would respect the ruling, while Apple said it was disappointed with the decision and accused the European Commission of “trying to retroactively change the rules”.
A separate ECJ ruling on Tuesday also brought an end to a long-running case with Google, with the company ordered to pay a fine of €2.4bn (£2bn) for market dominance abuse.
The EU antitrust chief Margrethe Vestager praised both judgments. “Today is a huge win for European citizens and tax justice,” she said.
The Apple ruling means the ECJ has finally upheld the decision issued by the European Commission in 2016 after a lengthy back-and-forth legal process.
The decision covered the period from 1991 to 2014, and related to how profits generated by two Apple subsidiaries based in Ireland were treated for tax purposes.
Those tax arrangements were deemed to be illegal because other companies were not able to obtain the same advantages.