WASHINGTON — APPLE got a big surprise last week when the European Commission ordered Ireland to collect more than $14 billion in back taxes from the company. The global giant had been attributing billions of dollars in profits to a phantom head office, allowing it to pay a tax rate of 1 percent or lower.

Both Apple and Ireland are appealing the decision, but the commission’s announcement was the latest sign that multinational corporations are running out of places to hide from paying taxes. The door is now open for Congress to fix our own corporate tax code, which has allowed the biggest multinationals to shirk their obligations for decades.

The Apple ruling is big, but it is only the latest international effort to end the deals that American multinationals have used to pay near-zero tax rates. The European Commission is investigating Luxembourg’s tax arrangements for Amazon and McDonald’s, and last year the European Court of Justice struck down tax advantages to companies and their subsidiaries selling e-books throughout Europe. Also last year, Britain enacted a new tax to target profits siphoned off by international companies — nicknamed, without much subtlety, the “Google tax.”

It’s not just Europe. The Organization for Economic Cooperation and Development and the Group of 20 nations are coordinating on a global effort to end the cross-border games that allow companies to avoid taxation by moving money among various subsidiaries. Multinational corporations are especially worried about losing access to Cayman Island-style tax rates in European countries where they can also get rule of law, political stability and an educated professional class of attorneys and consultants.