Apple isn't alone in taking advantage of the US tax system . Facebook also established an overseas subsidiary in Ireland largely for tax purposes—using what is known as the "Double Irish" technique—and named Dublin its base for business outside North America. But the Internal Revenue Service claims Facebook undervalued the move, and the IRS wants the California company to pay $1.7 million in taxes, plus interest, for the year 2010 and possibly subsequent years—an amount that Facebook says could reach billions.

Facebook, however, told the IRS late Tuesday in a court filing that it shouldn't have to pay. It's a tax fight likely to fuel the debate over tax loopholes, which have become a hot-button topic in the presidential race between Hillary Clinton and Donald Trump.

The social-networking site asked a US Tax Court to reverse the IRS' conclusion that Facebook undervalued property when it was transferred to Facebook Ireland Holdings Ltd. Not including intellectual property, Facebook assumed a value of roughly $5.8 billion; the IRS claimed nearly $14 billion.

"The entire amount of the deficiency is in dispute," Facebook told the Washington-based tax court in a legal filing. (PDF)

In July, Facebook notified shareholders that it could be on the hook for billions in back taxes. Facebook, in a filing with the Securities and Exchange Commission, told investors that "While the Notice applies only to the 2010 tax year, the IRS states that it will also apply its position for tax years subsequent to 2010, which, if the IRS prevails in its position, could result in an additional federal tax liability of an estimated aggregate amount of approximately $3.0 [billion]-$5.0 billion, plus interest and any penalties asserted."

Facebook and many other tech firms have recently come under increased scrutiny for using the "Double Irish" method to drastically—and legally—reduce tax burdens. The technique was phased out in early 2015, but companies already using it have until 2020 to transition to something else.

Facebook and federal tax regulators have also been battling over Facebook producing financial documents in connection to the tax dispute. The government has asserted that Facebook has failed to appear seven times with auditors at the IRS office in Silicon Valley and "did not produce the books, records, papers, and other data demanded."

The social network, in another court filing Tuesday, denied the accusations. "During the audit, Facebook produced thousands of pages of documents in response to more than 200 IRS requests, voluntarily extended the statute of limitation five times, and made employees available for interviews," the company wrote. (PDF)