The celebrations of Facebook's second quarter revenue results blowing away expectations and a stock surge of 59 percent might be short-lived after the social network was slapped with a tax bill that could cost it $5 billion.

The Inland Revenue Service audited the social media behemoth and concluded that it had undervalued its assets by billions when it transferred its properties to Ireland in 2010. The bill, which could be anywhere from $3bn to $5bn is for the years 2008 to 2013 and Facebook, despite fighting the tax charge, admitted that if the IRS was successful it could affect the company's business decisions going forward.

Facebook is planning to fight the tax charge but admitted "if the IRS prevails in the assessment of additional tax due based on its position, the assessed tax, interest and penalties, if any, could have a material adverse impact on our financial position, results of operations or cash flows."

Court filings reported that Ernst & Young, who handle Facebook's tax affairs, is believed to have allegedly undervalued the company's assets by evaluating parts of the business individually, rather than as a whole entity, meaning there was opportunity to shave a few tax dollars off here and there.

facebook
Money man: Facebook founder and CEO Mark Zuckerberg now has an estimated personal wealth of $56.4 billion Reuters

According to Bloomberg the IRS attempted to find further evidence that Ernst & Young's estimates were flawed but were met with resistance as Facebook produced "limited" documents, then declined to provide further details in a following request months later.

So how could this eye-watering tax bill affect Facebook? Will it mean there is less in the kitty for snapping up start-ups or perhaps its future vision for conquering virtual reality is at stake? No specifics were given but it is worth remembering that it just posted revenue of $6.4bn in the last quarter alone, making it as valuable as oil giants ExxonMobil at $375bn. Zuckerberg's own fortune now tips $56.4bn. There surely should be plenty of cash to cover the bill.