Apple Inc. may have to repay tax on billions of euros of revenues after the EU competition regulator called its tax deal with the Irish government “illegal state aid.”

The European Commission formally opened an investigation Tuesday into tax deals Apple made with the Irish government in 1991 and 2007. The investigation could take up to 18 months.

European governments have become  critical of tax arrangements used by giant U.S. technology companies such as Apple, Google, Amazon and Facebook to shift revenues to low-tax countries. Those deals are also under scrutiny in the U.S.

Apple funnels the bulk of its global profits through subsidiaries in Ireland, where it has negotiated very low tax rates. The EU estimates it pays as little as 3.7 per cent on anything it earns as profit outside the U.S.

EU competition commissioner Joaquín Almunia warned Tuesday that Apple could be required to pay taxes on those profits dating back 10 years at Ireland’s normal corporate tax rate of 12.5 per cent, an amount that would be millions of euros.

Special deal with Ireland

The European Commission is not challenging Ireland’s low stated corporate tax rate, but the special deal offered to companies such as Apple and Starbucks.

 EU rules forbid governments from offering state aid to companies, saying it undermines free market competition.

In a letter to the Irish government published Tuesday, it said the tax treatment granted to Apple "constitutes state aid" and therefore raises "doubts about the compatibility" with EU law.

Ireland has said it is not contravening the rules. Apple is the largest employer in Knocknaheeny, a run-down northern suburb of Cork where its international headquarters are based. About 40 U.S. companies have offices in the same area of Ireland.

The EU will probe transfer pricing by multinational companies -- where one part of a company charges an inflated price for goods or services to shift profits to another part of the company in a low-tax jurisdiction. Starbucks and Fiat tax practices are also being investigated.

If the EU finds after its investigation that Apple paid too little tax, the money is likely to go to the government coffers in Ireland, which has recently emerged from the debt crisis caused by the 2008 financial meltdown.

U.S. equally unhappy with Apple

But the company is also under pressure in the U.S. for its tax arrangements, which involve the creation of at least five Irish subsidiaries, some of which pay almost no taxes.

Senator Carl Levin, who published a damning report on Apple’s tax practices last year, issued a strong statement in support of the EU investigation.

“The facts are abundantly clear: Apple developed its crown jewels – lucrative intellectual property – in the United States, used a tax loophole to shift the profits generated by that valuable property offshore to avoid paying U.S. taxes, then boosted its profits through a sweetheart deal with the Irish government,” said Levin, who chairs the Senate Permanent Subcommittee on Investigations.

“Apple’s Irish tax rate has no rational basis; it was determined by what Apple was ‘prepared to accept’ – with the threat that it would cut jobs in Ireland if it didn’t get its way. That low tax rate came on top of Apple’s ploy of saying its three main Irish subsidiaries are not tax resident anywhere. Hopefully this finding will help persuade Congress that we should close the loopholes in our tax code that allow Apple-type gimmicks whose sole purpose is to avoid paying US taxes.”

Levin’s report held up Apple as an example of legal tax avoidance made possible by the complicated U.S. tax code, estimating the firm avoided at least $3.5 billion in U.S. federal taxes in 2011 and $9 billion in 2012 by using its tax strategy.

Apple — one the world's most valuable and profitable firms — sat on some $164 billion in cash and cash equivalents, with $138 billion stashed away in foreign subsidiaries, according to its latest quarterly report in June.

With files from the Associated Press