The European Union’s misguided attempt to wrest $14.5 billion in back taxes from Apple illustrates the pressing need for corporate tax reform in the United States. The tech giant never would have engaged with Ireland in the manner it did if America’s tax code were up to date and more competitive.

The current U.S. corporate tax rate of 35 percent is the highest of any industrial nation in the world. The way it works — or, rather, doesn’t work — has led U.S. firms to engage in the sort of complex tax arrangement that Apple has had with Ireland for the past decade.

The game is to negotiate deals to park profits in the country with the lowest available tax rate. This has led to U.S. companies keeping more than $2 trillion overseas to avoid paying the U.S. tax. It is beyond ridiculous.

Congress has made bipartisan progress in recent months toward revising the tax code. It’s unlikely to get done this year, but both parties need to work with the next president to quickly revise the system to stimulate economic growth and encourage investment in the United States. The code now does the opposite.

Apple CEO Tim Cook says last week’s ruling by the EU’s antitrust regulator should be overturned on appeal. He’s right. Apple has paid taxes according to Ireland and U.S. tax laws. The EU isn’t even disputing that point.

Instead, it claims that Ireland’s low 12.5 percent tax rate gives Apple an unfair advantage over its European competitors. It essentially picked a “fair” rate out of thin air and ordered Apple to pay the difference — $14.5 billion — retroactively.

The notion that the EU or any foreign government can target U.S. companies and decide which country should collect their taxes — and when, and how much — threatens to disrupt basic global business partnerships.

This ruling isn’t even in the EU’s interest, since it will make U.S. companies leery of investing in Europe.

Apple’s relationship with Ireland dates back to 1980, when Steve Jobs brought the company’s first European business operations to Cork. Apple and Ireland subsequently agreed to deals in 1991 and 2007 that allowed Apple to transfer its intellectual property rights to two of its subsidiaries in Ireland, Apple Sales International and Apple Operations Europe.

This allowed Apple to allocate taxable income to those subsidiaries, including paying appropriate taxes to Ireland at the lower rate. Apple can bring back the profits from its global sales to the United States at any point, but when it does, it will have to pay the 35 percent tax.

Cook said Apple announced last week that the company intends to bring back billions of those profits next year. Regardless, he and other tech leaders need to sit down with Democratic and Republicans leaders in Congress and collaborate on a fair system that encourages companies to maintain their headquarters and pay taxes to the nation where they’re truly based. That is — here.