Although litigation to force Ireland to recoup the taxes could drag on for years, the commission has successfully sued countries in the past and punished them with large fines for failing to recover money from companies that received illegal state aid.

At the time of the ruling, Europe’s competition watchdogs said that Apple’s arrangements with Dublin were illegal and had ensured the iPhone maker paid virtually nothing on its European business in some years. Brussels argued that the deals allowed Apple to funnel profit from two Irish subsidiaries to an office in which it had “no employees, no premises, no real activities.”

The Irish Department of Finance said that it “has never accepted the commission’s analysis” in the Apple case and that it was taken aback by Ms. Vestager’s decision to take the country to court. The department said it had “made significant progress on this complex issue” and accused the European authorities of taking a “wholly unnecessary step.”

Apple did not immediately comment on the latest move, but has criticized the ruling in the past. The original decision has also drawn the ire of the United States Treasury Department.

In the case of Amazon, the commission said Wednesday that Luxembourg had reduced its tax bill for more than eight years, from 2006 to 2014, and had conferred on the company a selective advantage. The arrangement essentially capped the amount of tax that the retailer paid, and relied on a method known as transfer pricing.

Typically, transfer pricing has been used by companies to assign revenues and profits to different business units depending on their location, role in the overall company and assets. But that system is harder to police with technology companies because many of their biggest assets, like intellectual property, are intangible. The European Commission said that Amazon had abused this system by sending most of its European revenue to a Luxembourg subsidiary that was not liable to pay corporate tax, helping the company cut its overall bill.

Ms. Vestager said the arrangement had “no valid economic justification” and that the company had been able to “avoid taxation on almost three quarters of the profits it made from all Amazon sales in the E.U.”