The European Union on Tuesday hit Apple with a $14.5 billion tax penalty, ruling its deal with Ireland was illegal.
EU antitrust regulators say the 13 billion euro payment to Ireland could be slashed if other countries, including the US, demand the company pay more within their own jurisdictions, the European Commission said in a statement.
"Member states cannot give tax benefits to selected companies -- this is illegal under EU state aid rules," Commissioner Margrethe Vestager said.
Apple is one of many US technology companies that have benefited from stashing cash overseas. That maneuver lets the companies avoid paying hefty taxes they could face by bringing the cash back to the US.
In this case, the iPhone maker reached a deal with Ireland to locate much of its earnings in the country in return for hiring there. That deal let Apple pay a much smaller tax rate than the 35 percent level in the US. Apple keeps more than 90 percent of its cash overseas.
Apple CEO Tim Cook responded to the EU ruling with a nearly 800-word statement posted to the company's website, saying there's "no basis in fact or in law" for the claim that Ireland gave Apple a sweetheart deal.
"The Commission's move is unprecedented and it has serious, wide-reaching implications," Cook wrote. "It is effectively proposing to replace Irish tax laws with a view of what the Commission thinks the law should have been."
Both Apple and Ireland plan to appeal the ruling. Apple said in a statement that it's "confident the decision will be overturned."
"The ruling is disappointing and, while Apple is confident in an appeal, the process may take several years" and could hurt Apple's stock in the meantime, Wells Fargo analyst Maynard Um noted. So far Tuesday, shares slipped only slightly, down less than 1 percent to $106.07.
From Apple Watch to iPhone 7: The evolution of Apple's products under Tim CookSee all photos
Tax deals in Ireland have come under scrutiny by the EU over the past couple of years. The EU believes Ireland hasn't been collecting enough taxes and instead has been giving companies like Apple too big of a break on Ireland's already low 12.5 percent tax rate.
The selective treatment allowed Apple to pay an effective corporate tax rate of 1 percent on European profits in 2003, according to the commission. In 2014, it paid a tax rate of 0.005 percent.
How did Apple get away with such a low rate? European regulators said that Apple had split the profits from its European sales, with only a small slice going to the Irish branch. The vast majority of the money went to a "head office" within Apple Sales International that was not based in any country and didn't face taxes, the commission said.
The ruling comes about a week before Apple is set to unveil its newest iPhone. The company generates more than two-thirds of its revenue from the device, and this model is expected to sport a better camera and ditch the headphone jack.
Apple had $231.5 billion in cash as of its quarterly earnings report last month. Nearly $215 billion of that is held overseas.
First published August 30, 2:58 a.m. PT.
Update, 5:19 a.m. PT: Added Apple's response to the EU ruling.
Update, 9:40 a.m. PT: Added analyst comments and stock price.
CNET's Nick Hide contributed to this story.