An international legal battle loomed on Monday as U.S. tech giant Apple and the Irish government looked set to challenge a European ruling on multi-billion dollar tax arrangements.

A statement by the European Commission body on Monday said the Irish government must ask Apple to pay a wrongly deducted amount in aid from previously occurred taxes.

The tax affairs in Ireland were worth up to €13 billion ($13.5) to Apple and were deemed illegal under EU rules.

Margrethe Vestager, the Commissioner in charge of competition policy, said member states could not give tax benefits to selected companies because to do so was illegal under EU state aid regulations.

“The Commission’s investigation concluded that Ireland granted illegal tax benefits to Apple, which enabled it to pay substantially less tax than other businesses over many years,” she added.

The European Commission examined Ireland’s tax affairs with Apple and concluded that the company lowered its tax bill in Ireland because two company branches were “stateless” — a status which gave the U.S. tech giant advantages in moving money.

“Ireland must now recover the unpaid taxes in Ireland from Apple for the years 2003 to 2014 of up to €13 billion, plus interest,” Monday’s council statement read.

However, the Irish government said it strongly disputed the decision, claiming the profits found taxable by the commission were not attributable to Ireland.

Apple previously said in a statement in August that the European Commission had launched “an effort to rewrite Apple’s history in Europe”.

It said: “The Commission’s case is not about how much Apple pays in taxes, it’s about which government collects the money. It will have a profound and harmful effect on investment and job creation in Europe. We will appeal and we are confident the decision will be overturned.”

Meanwhile, the Irish finance ministry also rejected the decision and published legal arguments Monday:

“Ireland does not accept the Commission’s analysis, which is why we have lodged an application with the General Court of the European Union to annul the whole Decision.”

“Ireland did not give favorable tax treatment to Apple — the full amount of tax was paid in this case and no State aid was provided. Ireland does not do deals with taxpayers,” the statement added.

“The Commission has misunderstood the relevant facts and Irish law,” it went on to say.

No more articles