(Reuters) - The U.S. Republican tax overhaul passed by Congress this week will allow Apple Inc AAPL.O to bring back its $252.3 billion foreign cash pile without a major tax hit - a long-standing company goal.

Other provisions of the bill, namely the cut in the corporate tax rate from 35 percent to 21 percent, are also a big boon for Apple.

But not everything went the company’s way. A critical difference between the Senate version of the bill and the final version could actually raise the amount of cash taxes that Apple pays on profits from patents held abroad, tax experts said.

The treatment of foreign patent profits is important to Apple because shifting those profits overseas was a cornerstone of its tax practices for decades.

In effect, the company attributes a large portion of the value of its products to patents and other intellectual property such as trademarks. Apple then assigns some of that IP, proportional to overseas sales, to subsidiaries in countries with low tax rates and assesses substantial patent royalties on sales. Those royalties then flow back to those low-tax locations, like Ireland.

The bill has a pair of provisions designed to make that maneuver less alluring. One creates a minimum tax on foreign patent income that is expected to come to about 13 percent, said Gavin Ekins, a research economist with the Tax Foundation.

At the same time, a tax break for patents held in the United States will lower the tax on licensing income from the standard corporate rate of 21 percent to 13.1 percent - about the same as if the patents were held abroad.

Congressional Republicans “don’t want the tax rate to be a consideration in where you put your intellectual property,” Ekins said. “The whole intention (of the measures) is to bring back that intellectual property to the United States.”

Parts of the scheme are similar “patent boxes” employed in countries like the United Kingdom to encourage firms to generate and keep their innovations at home.

FILE PHOTO: The Apple logo is pictured inside the newly opened Omotesando Apple store at a shopping district in Tokyo June 26, 2014. REUTERS/Yuya Shino/File Photo

But the final bill omits any explicit way for patents held overseas to be returned to the United States without being taxed.

Congress “screwed it up,” said Ed Kleinbard, a tax professor at the University of California and former chief of staff of the U.S. Congress’s Joint Committee on Taxation. “It’s kind of weird that they created the patent box, but didn’t give a pass to bring things back.”

For those patents that remain overseas, the minimum tax on foreign patent profits means Apple might actually face higher cash taxes abroad.

“I’m willing to bet a dollar that 13.1 percent is higher than Apple’s actual non-U.S. tax rate,” said Kleinbard. “It’s entirely possible their cash tax bill going forward would go up based on this alone.”

Apple Chief Executive Tim Cook has said the company intends to bring some overseas cash home, but the company declined to comment on precisely how much or how it would use the funds.

Gary Hufbauer, a fellow with the Peterson Institute for International Economics, said the tax cut is not likely to spur Apple to start building iPhones in the United States. However, Apple’s U.S. suppliers, which the company said it spent $50 billion with in 2016, will also see lower taxes.

If those suppliers pass their tax savings along in the form of lower prices offered to Apple, it could make them more competitive against foreign rivals and entice Apple to spend more with them, Hufbauer said.

QUESTIONS ON USE OF CASH

The repatriation rules will change the way Apple manages its cash, analysts said. Companies now have to pay a one-time 15.5 percent tax on their overseas cash to bring it back.

After that, companies will pay 21 percent tax on U.S. profits and a minimum 10.5 percent tax on foreign profits, but they will be able to deduct foreign taxes already paid on those profits, so in many cases the foreign profits can be brought home with no additional U.S. taxes paid.

At 15.5 percent, Apple would owe about $39.1 billion on its $252.3 billion in overseas cash. Unlike many other large companies, Apple has already set aside $36.3 billion for that purpose.

With the remaining cash, Apple could attack its $97 billion in long-term debt, much of which it has used to fund its dividend and share buy-back program.

“The (foreign cash) overhang for Apple is just an enormous issue,” Kleinbard said. “Even Apple has finite borrowing capacity. This removes the issue.”

(Corrects paragraph five to reflect that not all of Apple’s intellectual property is assigned to foreign subsidiaries.)