The amount of back taxes Apple is being ordered to repay was previously unclear, and was thought to be anything from €1bn (£854m) upwards.
The figure of €13bn (£11.1bn), however, makes this Brussels’ biggest attack on tax avoidance by a US multinational to date. The ruling refers to deals struck between Apple and the Irish state in 1991 and 2007.
In an announcement, the EC said: "The European Commission has concluded that Ireland granted undue tax benefits of up to €13 billion to Apple.
"This is illegal under EU state aid rules, because it allowed Apple to pay substantially less tax than other businesses. Ireland must now recover the illegal aid."
Competition commissioner Margrethe Vestager said: "Member States cannot give tax benefits to selected companies – this is illegal under EU state aid rules. 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.
"In fact, this selective treatment allowed Apple to pay an effective corporate tax rate of 1 per cent on its European profits in 2003 down to 0.005 per cent in 2014."
Apple hit back, saying the EC was attempting to "rewrite Apple's history in Europe, ignore Ireland's tax laws and upend the international tax system in the process.
"The Commission's case is not about how much Apple pays in taxes, it's about which government collects the money," said the tech company. "It will have a profound and harmful effect on investment and job creation in Europe."
The move will cause indignation in Washington. Last week, the US Treasury accused the EC of trying to act like a "supranational tax authority", saying its actions were undermining global tax reform.