Ireland should recover up to €13bn from Apple in back taxes, the European Commission has ruled.
After a three-year investigation, it has concluded that the US firm's tax benefits are illegal.
The Commissions's investigation found that although the standard rate of Irish corporate tax was 12.5 percent, Apple had effectively paid 1 percent tax on its European profits in 2003 and about 0.005 percent in 2014.
Both Apple and the Irish government have denied there was a special deal between them, and have indicated they will appeal against the commission's order.
Apple said it was confident of winning an appeal against a decision it said would have a profound and harmful effect on investment and job creation in Europe.
"Member states cannot give tax benefits to selected companies - this is illegal under EU state aid rules," Commissioner Margarethe Vestager said.
"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."
Ms Vestager said that the tax agreement reached between Ireland and Apple meant that the company's taxable profits "did not correspond to economic reality".
'Profound and harmful effect'
Apple said the decision would be harmful for jobs.
"The European Commission has launched an effort to rewrite Apple's history in Europe, ignore Ireland's tax laws and upend the international tax system in the process," the company said in a statement.
"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.
"Apple follows the law and pays all of the taxes we owe wherever we operate. We will appeal and we are confident the decision will be overturned."
The Irish government held a similar view.
"I disagree profoundly with the Commission," said Ireland's finance minister, Michael Noonan, in a statement.
"The decision leaves me with no choice but to seek cabinet approval to appeal.
"This is necessary to defend the integrity of our tax system; to provide tax certainty to business; and to challenge the encroachment of EU state aid rules into the sovereign member state competence of taxation."
The investigation into Apple and similar probes into other US firms have been criticised by US authorities.
Last week, the US Treasury Department said the European Commission was in danger of becoming a "supra-national tax authority" overriding the tax codes of its member states.
Brussels was using a different set of criteria to judge cases involving US companies, the US Treasury warned, adding that potential penalties were "deeply troubling".
Apple is not the only company that has been targeted for securing favourable tax deals in the European Union.
Last year, the commission told the Netherlands to recover as much as €30m from Starbucks, while Luxembourg was ordered to claw back a similar amount from Fiat.