Maybe you had to file for an extension this year, or ask for a payment plan, because you didn't pay all your taxes on time. If so, you have company: Facebook revealed in its quarterly financial report on Thursday that it's under investigation by the IRS, and that investigation could lead to payments of $3 to $5 billion. Plus interest and penalties.

How could this have happened? Because of a tax strategy called "Double Irish," used by Facebook and other multinational Internet companies. It works like this: Facebook's subsidiaries in other countries pay to use Facebook's software and intellectual property. But they don't pay that money to the American parent company. 

Instead, Facebook transferred rights to its intellectual property to its Irish subsidiary, and subsidiaries in countries other than the U.S. and Canada paid those cost-sharing fees to that Irish subsidiary instead of to the parent company. Why? Corporate income tax in Ireland is 12.5 percent. It's officially 35 percent in the United States, although in practice that can vary.

Strange as it sounds, all this is perfectly legal, although the option is being phased out. But the IRS claims that Facebook not only moved assets to Ireland so as to avoid paying U.S. taxes, but also undervalued those assets so that it underpaid taxes when it sold them to the Irish subsidiary. That's the reason for the investigation and the potential multi-billion-dollar payment.

Facebook plans challenge.

Not surprisingly, Facebook says it disputes the IRS claims. "We do not agree with the position of the IRS and will file a petition in the United States Tax Court challenging the Notice," Facebook's filing says. Asked for further comment, the company told Fortune: "Facebook complies with all applicable rules and regulations in the countries where we operate."

Maybe, but not quickly. According to a complaint filed by the IRS in federal court, Facebook has failed to fully comply with seven different summonses, including an order to appear at an IRS office on June 29. The IRS also said the company has supplied only some of the documentation it requested. 

It will be interesting to see how this plays out.