Apple has been landed with by far its biggest tax bill ever this week as the European Commission has deemed its special scheme for paying tax in Ireland illegal.

Now Apple and the Irish government are preparing to appeal the decision and hopefully save Apple billions of dollars in the process.

The illegal tax benefits the European Commission identified relate to the way in which Apple pays tax in Ireland. The tech company pays its taxes in Ireland for all the gadgets and services it sells across Europe. The problem is, Apple has a special scheme agreed with the Irish government that means its tax rate has been as low as 0.005% in 2014. As early as 2003 the rate was already down to 1%.

Rather than a legal tax arrangement, the Commission has found this to instead class as illegal state aid offered by the Irish government. So Apple is now being asked to pay a $14.5 billion penalty plus interest to the Irish government. The ruling will also mean an end to the special scheme if it stands.

Apple won’t have any problem covering $14.5 billion as it has cash reserves of around $213.5 billion, but the company has no intention of paying this penalty bill. In fact, Apple has described the demand as an “effort to rewrite Apple’s history in Europe” and a decision that will “have a profound and harmful effect on investment and job creation in Europe.”

That sounds like a threat by Apple to Europe if it continues to try and make it pay a reasonable amount of tax. I think we can all agree 0.005% isn’t reasonable, right?

The Irish government is also going to appeal the decision as it believes the integrity of the tax system is in jeopardy if it stands. The likely outcome of the appeals process will be a reduced bill that still equates to billions, but also a change to the tax paying agreement Apple has enjoyed until now.