Apple is preparing to appeal an imminent order that it pay back years of unpaid taxes to the Irish state should the European Commission rule this week that Ireland gave the tech giant illegal state aid.

The European Commission is expected to declare this week that deals stretching back 25 years between Apple and the Irish state gave the company an unfair advantage. In what is by far the biggest case of its kind, Apple could be ordered to pay back billions, although the sum is expected to be significantly lower than the $19bn (£14.5bn) that has been suggested.

Apple and the Irish government are both expected to signal soon after the decision that it will be appealed. Tim Cook, the company’s chief executive, said recently that Apple will fight the ruling if the company feels it has not had “a fair hearing”, while Michael Noonan, the Irish finance minister, has said the government will appeal any negative finding.