Irish ministers confirmed on Friday, after days of talks, that they will appeal against the European Union's Apple tax ruling.

Earlier this week, Ireland was ordered by the European Commission, the executive arm of the EU, to reclaim €13 billion plus interest in back taxes from Apple.

The issue initially threatened to split the government with independent ministers saying they were reluctant to challenge the decision.

On Tuesday, the EU’s competition chief Margrethe Vestager said that a two-year investigation into so-called sweetheart tax deals in 1991 and 2007 had found Apple guilty of receiving illegal state aid from Ireland. It had allowed Apple to pay an effective corporate tax rate of one percent on its European profits in 2003, down to as low as 0.005 percent in certain years, according to Vestager.

Apple has vehemently disputed the claim and said it will appeal against the ruling.

The Irish government has similarly denied any wrongdoing. Immediately after Vestager revealed her decision, Finance minister Michael Noonan said Ireland must launch an appeal against it. But independent ministers resisted and the cabinet failed to reach agreement on Wednesday.

On Friday afternoon a compromise was finally reached during a short cabinet meeting. Ireland will appeal against the ruling that it had supplied illegal state aid worth €13 billion to Apple, but—in a concession to reluctant MPs—an independent review of the tax treatment of multinationals in the country will take place.

The Dáil, which is the lower house of the Irish parliament, will meet next Wednesday to approve the plan, Noonan said.

"Our appeal will be founded on advice and documentation of the attorney general," added Noonan. He claimed "no preferential treatment" had been dished out to Apple.

"Apple constructed it's company to use the tax regime. Any company could have done the same. This is an intrusion beyond the competence of the commission," he said.

Irish Minister for public expenditure Paschal Donohoe expressed concern about the impact of the decision on jobs and the economy.

The nature of the ruling was unprecedented in terms of the consequences for the Irish economy. This ruling has seismic and entirely negative consequences for job creation in the future. We need to maintain the jobs we have and develop jobs for the future. There is a clear intention to emphasise the certainty of the tax code. This government stands fully behind our tax regime. We reviewed how important this policy is.

Noonan said: "There’s envy across Europe about how we’ve managed to establish so many HQs in Dublin. We stand by our 12.5 percent tax rate."

Apple has also said it will appeal against the decision. Its chief Tim Cook didn’t mince his words on Wednesday, calling the ruling "total political crap." Vestager refuted that claim and said the decision was based on the facts of the case.