Apple and the Irish government are reportedly nearing a deal that would shield the latter from losses incurred while holding up to $17.7 billion in Apple cash, including interest — money that may be due in back taxes following a 2016 European Commission ruling.

Even if the government ultimately returns the money to Apple, it wants to be sure it isn't liable for any drops in value, Bloomberg said on Friday. One of two sources for the publication indicated that an agreement could come within the next few weeks.

Ireland is well behind schedule in collecting the money. The original deadline was Jan. 3 — by May, the Commission was warning that the country could end up in court. In July the Irish government said it was still finalizing arrangements.

In August 2016, the Commission ruled that Ireland had offered "illegal tax benefits" to Apple, which it also said had been "reverse engineered" to ensure they stayed low. The company is estimated to have paid 1 percent in 2003, and as little as 0.005 percent in 2014 — despite using the country to funnel billions in international revenue.

The decision was immediately met with stiff opposition by Apple, Ireland, and the U.S. government. An Irish appeal is currently underway, but could take as long as five years, and may still be unsuccessful.

"We continue to cooperate with Ireland on the recovery process the commission has mandated but remain confident that once the General Court of the EU has reviewed all the evidence it will overturn the commission's decision," Apple said in a statement on Friday.