Brussels said Apple, the world's most valuable company, avoided virtually all tax on its business in the bloc by illegal arrangements with Dublin which gave the company an unfair advantage over competitors.

Apple and the Irish government immediately said they would appeal against the European Commission ruling, with the iPhone maker warning it could cost European jobs.

The White House meanwhile cautioned against "unilateral" measures by the EU.

The US tech and software giant has vowed it will appeal the ruling, saying the move will compromise investment and job creation in Europe.

The company's shares lost some of their shine after the ruling, down 0.7 percent in early afternoon trading, making for a more than 3 percent loss over the past two weeks ahead of the highly anticipated ruling.

"This decision sends a clear message. Member states cannot give unfair tax benefits to selected companies, no matter if European or foreign, large or small," EU Competition Commissioner Margrethe Vestager said.

"The Commission's investigation concluded that Ireland granted illegal tax benefits to Apple, which enabled it to pay substantially less tax than other businesses over many years," she added.

Ireland has attracted multinationals over many years by offering extremely favourable sweetheart tax deals to generate much-needed jobs and investment.

But after a three-year investigation Brussels said the arrangement with Apple broke EU laws on state aid.

The findings come amid growing tensions between Washington and Brussels over a series of EU anti-trust investigations targeting other giant US companies such as Google, Amazon, McDonald's, Starbucks and Fiat Chrysler.

RELATED READING

Apple issues update to fix dangerous iPhone, iPad security flaw

A thwarted attack on a human rights activist has prompted Apple to issue a patch to fix a security flaw in iPhones and iPads.

'Devastating blow'

Apple has had a base in the southern city of Cork since 1980 and employs nearly 6,000 people in Ireland, through which it routes its international sales totalling billions.

Apple chief Tim Cook said he was "confident" the EU ruling would be overturned, adding that the Silicon Valley giant was the biggest taxpayer in Ireland, the United States and the world.

"The most profound and harmful effect of this ruling will be on investment and job creation in Europe," he said.

Cook also warned that the ruling was a "devastating blow to the sovereignty of EU member states over their own tax matters", echoing the concerns of Dublin over the decision.

Ireland's Finance Minister Michael Noonan described the ruling as "bizarre" and "an exercise in politics by the Competition Commission".

Dublin, which suffered from harsh austerity measures after it was bailed out during the eurozone debt crisis, has vigorously defended its low tax rates as a way of boosting the economy.

"If you look at the small print on an Apple iPhone, it says designed in California and manufactured in China and that means any profits that accrued didn't accrue in Ireland and so I can't see why the tax liability is in Ireland," he said.

But Vestager said Apple's Irish operation was a sham -- Apple's "so-called head office in Ireland only existed on paper. It had no employees, no premises and no real activities."

Apple paid an effective corporate tax rate of just 0.005 per cent on its European profits in 2014 -- equivalent to just 50 euros for every million, Vestager said.

The Apple tax bill dwarfs the previous EU record for a state aid case -- 1.3 billion euros for the Nurburgring race track in Germany.

While the 13-billion-euro ($14.5-billion) sum itself is unlikely to trouble Apple with its massive $600 billion of market capitalisation and $234 billion in revenue last year, the political ramifications are huge.

US anger

Washington has made increasingly angry comments over the case in recent weeks, and on Tuesday it echoed Apple's warnings that the tax bill could hurt the European economy.

"We are concerned about a unilateral approach," said White House spokesman Josh Earnest, adding that the move "threatens to undermine progress that we have made collaboratively with the Europeans to make the international taxation system fair."

The US Treasury said the ruling "could threaten to undermine foreign investment, the business climate in Europe, and the important spirit of economic partnership between the US and the EU."

The Apple decision may also complicate struggling EU-US talks on what would be the world's biggest free trade deal, meant to be completed before US President Barack Obama steps down in January.

French President Francois Hollande on Tuesday said he doubted agreement could be reached by then.

Tax avoidance has moved sharply up the political agenda since EU governments adopted tough austerity policies to balance the public finances, driving public resentment that the rich paid relatively little tax.

The issue was highlighted close to home by the LuxLeaks scandal which revealed that European Commission President Jean-Claude Juncker's native Luxembourg gave companies huge tax breaks while he was prime minister.

In October Brussels ordered US coffee giant Starbucks and Italian automaker Fiat to each repay up to 30 million euros ($34 million) in back taxes to the Netherlands and Luxembourg respectively.