FLICKR/Elyse Archie
The tax crackdown sets up a bigger fight with US technology giants.
Margrethe Vestager, the commissioner in charge of competition policy, said: "Tax rulings that artificially reduce a company's tax burden are not in line with EU state aid rules. They are illegal. I hope that, with today's decisions, this message will be heard by Member State governments and companies alike. All companies, big or small, multinational or not, should pay their fair share of tax."
The EU said both companies would have to pay back as much as €30 million ($34 million) each.
"It also means that the companies can no longer continue to benefit from the advantageous tax treatment granted by these tax rulings. Furthermore, the Commission continues to pursue its inquiry into tax rulings practices in all EU Member States," the EU said in the statement.
The agreements - in the form of so-called "comfort letters" - amount to illegal state help for corporations, the EU argued. While Luxembourg and the Netherlands both claim that the tax structures were legal, the cases signal the EU's willingness to crack down on controversial schemes that let big companies pay less tax than official rates.