Ireland should recover up to €13bn (£11bn) from Apple in back taxes, the European Commission has ruled.
After a three-year investigation, it has concluded that the US firm's Irish tax benefits are illegal.
The Commission said Ireland enabled the company to pay substantially less than other businesses, in effect paying a corporate tax rate of no more than 1%.
Ireland and Apple both said they disagreed with the record penalty and would appeal against it.
"Member states cannot give tax benefits to selected companies - this is illegal under EU state aid rules," said Commissioner Margrethe Vestager.
"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 standard rate of Irish corporate tax is 12.5%. The Commissions's investigation concluded that Apple had effectively paid 1% tax on its European profits in 2003 and about 0.005% in 2014.
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 record tax bill should not be a problem for Apple, which made a net profit of $53bn in the 2015 financial year.
"Apple has been enjoying a river of free cash flow and while the ruling may not been too much short-term, investors will have to assess whether a higher tax bill will have any impact on profits after tax," said Neil Wilson, market analyst at ETX Capital.
The US Treasury, which said last week that the European Commission was in danger of becoming a "supranational tax authority", said the latest ruling could "undermine foreign investment, the business climate in Europe, and the important spirit of economic partnership between the US and the EU".