Apple Inc. was ordered to pay as much as $14.5 billion plus interest after the European Commission ruled that Ireland illegally slashed the iPhone maker’s tax bill, in a record crackdown on fiscal loopholes that also risks inflaming tensions with the U.S.

The world’s richest company benefited from selective tax treatment that gave it an unfair advantage over other businesses, the European Union regulator said Tuesday. It’s the largest tax penalty in a three-year campaign against corporate tax avoidance. Apple and Ireland both vowed to fight the decision in the EU courts.

Ireland allowed Apple to pay an effective corporate tax rate of 1 percent on its European profits in 2003, declining to 0.005 percent in 2014, according to EU Competition Commissioner Margrethe Vestager.

“If my effective tax rate would be 0.05 percent falling to 0.005 percent, I would have felt that maybe I should have a second look at my tax bill,” she told reporters.

The U.S. Treasury Department, which has pushed back hard against the EU state-aid probes, said the commission’s actions “could threaten to undermine foreign investment, the business climate in Europe, and the important spirit of economic partnership between the U.S. and the EU.”

White House Press Secretary Josh Earnest said Apple executives have shared concerns about the company’s tax treatment overseas with officials in President Obama’s administration.

Administration officials are broadly concerned that what Earnest called the EU’s “unilateral approach” doesn’t undermine coordinated efforts to prevent an “erosion of the tax base.” Also, he said, they want to ensure that any actions are fair to U.S. taxpayers and U.S. businesses.

Apple, which employs about 6,000 people in Ireland, was one of the first companies caught up in the EU’s backlash against corporate tax-avoidance. The EU, like other global regulators, has targeted firms that sidestep taxes by moving around profits and costs to wherever they are taxed most advantageously – exploiting loopholes or special deals granted by friendly governments.

“The most profound and harmful effect of this ruling will be on investment and job creation in Europe,” Apple CEO Tim Cook said in a letter published on the company’s website. “Every company in Ireland and across Europe is suddenly at risk of being subjected to taxes under laws that never existed.”

While the $14.5 billion figure represents the EU’s estimate of how much Ireland should claw back from Apple, the commission said the actual figure could be less if other nations used the information gleaned by the EU to claim a share of taxes.

Irish Finance Minister Michael Noonan said in an interview with Bloomberg TV that Vestager was advising countries to “in effect, form a queue and look for that tax.”

The commission said the amount could be reduced if the U.S. required Apple to pay larger amounts of money to its American parent company to finance research and development efforts.

Ultimately, the EU courts also have the power to cut or overturn repayment orders if they find fault with the commission methodology during the appeals process.

But such challenges can take years to finalize, meaning the final sum that Apple may have to pay won’t be known until then. The money clawed back can be held in escrow pending a ruling.

While $14.5 billion is the highest ever sought by the EU in a state-aid case, it is unlikely to leave the company short of money. As of last month, Apple had $232 billion in cash, with about $214 billion of that being held overseas. Apple generated about $4.45 billion a month last year, meaning the decision would eat up about three months of profit.

Apple’s stock declined by less than 1 percent Tuesday.

Low corporate taxes are the cornerstone of Irish economic policy, with the 12.5 percent rate the lowest in Western Europe and a draw for Alphabet Inc.’s Google and Facebook Inc. to Dublin. More than 700 U.S. companies have units there, employing 140,000 people, according to the American Chamber of Commerce in Ireland.

“It’s strange to think that Ireland would not want to collect more taxes from Apple, but Ireland’s primary concern here is protecting domestic investment and jobs,” said Matt Larson, an analyst at Bloomberg Intelligence.