Apple chief Tim Cook said the tech giant will appeal the European Union’s decision ordering it to pay upwards of $14.5 billion in unpaid taxes to Ireland, and the claim that Apple had an illegal sweetheart deal with the country has “no basis in fact or in law.”

“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,” Cook wrote in a letter posted Tuesday on the company’s website. “We now find ourselves in the unusual position of being ordered to retroactively pay additional taxes to a government that says we don’t owe them any more than we’ve already paid.”

Ireland also will appeal the E.U. ruling, which charged that Apple’s agreements with Irish tax authorities in 1991 and 2007 violated E.U. rules on state aid forbidding preferential treatment for individual companies. In announcing the decision Tuesday, E.U. competition commissioner Margrethe Vestager alleged that the deals allowed Apple to channel European sales through Ireland and benefit from an ultra-low tax bill that declined from an effective corporate tax rate of 1% on its European profits in 2003 down to a minuscule 0.005% in 2014.

But Cook countered that Apple “never asked for, nor did we receive, any special deals.” According to the CEO, the company has complied with Irish tax laws and that the E.U.’s “unprecedented” move is “not about how much Apple pays in taxes. It is about which government collects the money.”

Ireland’s finance minister, Michael Noonan, said in an interview with broadcaster RTE said there was “no economic basis” for the E.U.’s decision. “It’s bizarre and its an exercise in politics by the Competition Commission,” he said, per a Reuters report.

It’s not like Apple would have trouble paying the tab: The company reported about $146.6 billion in cash and equivalents and marketable securities (minus debt) as of June 25.

As far as taxes it has paid, Apple reported $12.5 billion in income tax provisions for the first nine months of 2016, versus $15.2 billion in the year-earlier period. For its fiscal year ended Sept. 26, 2015, Apple recorded provisions for foreign taxes of $2.9 billion (out of $19.1 billion overall), compared with $1.49 billion in 2014 and $1.13 billion in 2013.

Apple opened its factory in Cork, Ireland, in 1980 with 60 employees and now has nearly 6,000 employees across Ireland. Cook said Apple is today the largest taxpayer in Ireland, as well as in the U.S. and in the world. Cook added that Apple supports international tax reform to simplify and clarify rules, but that such changes should be enacted through legislative means not through retroactive regulatory enforcement.

“We are committed to Ireland and we plan to continue investing there, growing and serving our customers with the same level of passion and commitment,” Cook wrote. “We firmly believe that the facts and the established legal principles upon which the E.U. was founded will ultimately prevail.”