Apple will start paying back some €13 billion in back taxes to Ireland in 2018.

The Cupertino firm was found to owe the money in a ruling in 2016 which found that Apple and Irish tax officials had made deals between 1991 and 2007 which amounted to state aid.

“We have now reached agreement with Apple in relation to the principles and operation of the escrow fund,” Finance Minister Paschal Donohoe told Reuters.

The European Commission (which made the original ruling) expects the money to be transferred to an escrow account during the first quarter of the new year.

What did Apple do exactly to warrant a payment as big as €13 billion?

It has more to do with what it hasn’t done. A number of firms exploit the European Union’s free trade laws by setting up offices in countries that offer low corporate taxation rates.

These firms then bill all sales made in the European Union in that low tax region. Not only is it ethically questionable, the European Commission declared this as state-aid which is illegal.

Both Apple and Ireland will still appeal the ruling despite Apple agreeing to make a payment.