Apple Inc won its court fight over a record €13bn ($14.9bn) Irish tax bill in a crushing blow to European Union Competition Commissioner Margrethe Vestager’s crackdown on preferential fiscal deals for companies.

The judgment by the EU’s lower court on Wednesday vindicates Apple chief executive officer Tim Cook’s challenge against a decision he labelled as ‘political crap.’

While the EU General Court’s ruling can still be appealed, judges delivered a stinging attack on the European Commission for failing to show ‘to the requisite legal standard’ that Ireland’s tax deal broke state-aid law by giving Apple an unfair advantage.

‘The commission’s intent seemed to be a political one: to punish Apple for its overall tax planning, rather than to reach a result that accorded with the legal or economic position,’ Dan Neidle, a tax lawyer with Clifford Chance said in a statement. ‘The court has, quite rightly, followed the law and not any wider political objectives.’

The Apple case is the hallmark of Vestager’s five-year campaign to get rid of allegedly unfair tax deals that some EU governments dole out to favored multinationals including the likes of Inc Apple’s fury at its 2016 tax bill led Cook to blast the EU move.

The EU will consider its next steps after studying the Luxembourg-based court’s judgment, Vestager said in a statement.

‘If member states give certain multinational companies tax advantages not available to their rivals, this harms fair competition,’ she said, adding that the EU ‘will continue to look at aggressive tax planning measures under EU state aid rules.’

Apple said the case ‘was not about how much tax we pay, but where we are required to pay it.’ The firm ‘has paid more than $100bn in corporate income taxes around the world in the last decade and tens of billions more in other taxes.’

The Cupertino, California-based company had argued the EU wrongly targeted profits that should be taxed in the US and ‘retroactively changed the rules’ on how global authorities calculate what’s owed to them.

The Irish finance ministry said the nation ‘has always been clear that there was no special treatment provided to the two Apple’ units in the EU’s state-aid case. The ruling is a vindication for the country, which had been criticised by puzzled voters who couldn’t fathom why the country wouldn’t accept a windfall from one of the globe’s richest companies.

Apple’s huge sales — like those of other US tech giants — have attracted particular scrutiny in Europe, focusing on complicated company structures for transferring profits generated from intellectual property.

The case comes as Apple is getting close to overtaking Saudi Arabia’s state-owned oil company in market valuation, a milestone that would make the technology giant the world’s largest company by that measure. Its shares have rallied about 30% this year on broad optimism about its businesses.

Before Thursday Vestager already had a mixed record in the court cases that followed her tax orders. The Dane suffered a setback last year when judges faulted a decision targeting Starbucks Corp over its tax deals with the Netherlands. But the tribunal upheld the EU’s decision concerning Fiat Chrysler Automobiles NV’s tax affairs in Luxembourg.

‘Vestager has made a very valiant effort to use the tools that were at her disposal but we all knew from the start that those tools were not meant for the purpose,’ said Sophie in ’t Veld, a Dutch member of the EU Parliament’s Liberal group.

She said the decision will be welcomed by Ireland, but ‘I cannot see how you can be happy that you let a tech giant off the hook when we’re talking about paying 13bn euros — it will have to be coughed up by taxpayers now.’