A statement from the European Commission said it had concluded that Ireland granted undue tax benefits of up to €13 billion to Apple.
"This is illegal under EU state aid rules because it allowed Apple to pay substantially less tax than other businesses. Ireland must now recover the illegal aid," it said.
EU competition commissioner Margrethe Vestager said Apple's "selective treatment" in Ireland resulted in an effective tax rate of one per cent on its European profits in 2003. This rate fell to 0.005 per cent by 2014.
"Member states cannot give tax benefits to selected companies – this is illegal under EU state aid rules. 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."
Graphic courtesy of the European Commission.
The EU launched its investigation into Apple's tax arrangements in Ireland in 2014.
The Commission statement said it had concluded that two tax rulings issued by Ireland to Apple had substantially and artificially lowered the tax paid by Apple in Ireland since 1991.
"The rulings endorsed a way to establish the taxable profits for two Irish incorporated companies of the Apple group (Apple Sales International and Apple Operations Europe), which did not correspond to economic reality: almost all sales profits recorded by the two companies were internally attributed to a 'head office'." it said.
"The Commission's assessment showed that these 'head offices' existed only on paper and could not have generated such profits. These profits allocated to the 'head offices' were not subject to tax in any country under specific provisions of the Irish tax law, which are no longer in force."
The ruling said the tax treatment in Ireland enabled Apple to avoid taxation on almost all profits generated by sales of Apple products in the entire EU Single Market.
"This is due to Apple's decision to record all sales in Ireland rather than in the countries where the products were sold. This structure is, however, outside the remit of EU state aid control," it said.
"If other countries were to require Apple to pay more tax on profits of the two companies over the same period under their national taxation rules, this would reduce the amount to be recovered by Ireland."
Apple and Ireland are both expected to appeal.