In a case playing out in federal court, the Internal Revenue Service (IRS) says Medtronic’s internal accounting at its medical device factories in Puerto Rico a decade ago was a “poster child” for a type of tax avoidance that Congress sought to prevent when it rejiggered the tax code in the 1980s.

The IRS is trying to persuade federal judges to increase Medtronic’s taxable income by about $1.4 billion, claiming that the medical device maker failed to accurately account for the value of the trade secrets and other “intangibles” used by Medtronic’s Puerto Rico manufacturing subsidiary in 2005 and 2006.

Medtronic stands behind its accounting, and says it actually overpaid the tax in that period. Medtronic essentially won the debate last year with a favorable 144-page ruling from the U.S. Tax Court, but the IRS has appealed that decision to the Eighth U.S. Circuit Court of Appeals. Oral arguments are expected next year, with hundreds of millions of dollars in back taxes potentially at stake.

IRS auditors say Medtronic shifted profit to a low-tax jurisdiction by having its accountants allocate 60 percent of the operating profits on paper to the Puerto Rico manufacturing operations, even though the island factories contributed 11 percent of the costs of manufacturing. The Tax Court judge who sided with Medtronic last year said the IRS belittled the role of the Puerto Rican factories, which deserved more than 11 percent of the profits because they played critical roles in design, quality control and risk management.

“The more functions you are doing, the more risks you are assuming, the greater share of the profit you should get,” said James Loizeaux, director of global tax services for accounting firm CliftonLarsonAllen in Minneapolis.

At the center of the dispute is a process known as “transfer pricing,” which involves quantifying the value of intangible assets like trade secrets and regulatory approvals. Transfer pricing is an important issue for multinationals with valuable intellectual property like Medtronic, because it helps determine how much profit can be taxed in low-tax countries. Congress is considering amending transfer pricing laws as part of a broader tax reform.

Medtronic had less taxable income in the U.S. in 2005 and 2006 because it recognized so much of the profits from Puerto Rico-made pacemakers, neurostimulators and lead wires outside the U.S., court filings show. The IRS says Medtronic’s factories in Puerto Rico should have been paying more in royalties to the parent company, which then could have been taxed in the U.S.

Medtronic’s decade-old tax controversy may have broader implications, for the company and industry at large. Although the case at the Eighth Circuit only involves Medtronic’s 2005 and 2006 Puerto Rico-related taxes, securities filings show Medtronic has yet to settle similar tax questions for 2007 through 2014.

Medtronic spokesman Fernando Vivanco confirmed that a final decision on 2005 and 2006 taxes “could have implications” for Medtronic’s subsequent tax years, but he declined to speculate or to discuss the case further because it’s in active litigation.

More broadly, tax experts are closely watching the outcome of the IRS’ dogged pursuit of Medtronic. Last year, industry trade publication International Tax Review put Medtronic’s transfer-pricing dispute with the IRS at the top of its list of significant U.S. tax controversies for the year. The IRS’ tough stance in the Medtronic case is somewhat surprising, tax-law experts say, given that transfer pricing disputes require interpreting estimated ranges in retrospect.

“It’s an art, to some extent,” said Guy Sanschagrin, a Minnesota-based certified public accountant who heads up the transfer pricing and valuation practice at tax advisory firm WTP Advisors. “Usually in transfer pricing, we are looking at ranges of results. Even the regulations acknowledge that in transfer pricing … usually there is a range of possible outcomes that would conform to the arm’s-length standard.”

The “arm’s-length standard” is what IRS accuses Medtronic of manipulating in Puerto Rico in 2005 and 2006.

The Internal Revenue code taxes royalties paid to U.S. companies for the value of trade secrets used in manufacturing in lower-tax countries. But Congress recognized such rules create a financial incentive for companies to overstate the importance of their operations overseas, and minimize the role of the U.S. mainland company.

So the tax code, as amended by Congress in 1986, allows the IRS to analyze whether the royalties are out of whack, and if so, to adjust them to values that would apply if the two entities were negotiating the value of the trade secrets in an “arm’s length” transaction between unrelated parties.

“This dispute involves the classic case of a U.S. multinational taxpayer [Medtronic] shifting income from its highly profitable U.S. operations and intangibles to an offshore subsidiary operating in a tax haven [Medtronic-P.R.], by charging an artificially low royalty rate for the intangibles,” the IRS wrote in an Oct. 25 filing with the Eighth Circuit. “This case is a poster child for the target of Congress’ concern.”

In the IRS’ filings, “Medtronic-P.R.” refers to the Medtronic Puerto Rico Operations Co., or MPROC, which was actually incorporated in the Cayman Islands in 2002 after Congress began to phase out long-standing tax benefits of running a subsidiary based directly in Puerto Rico. A footnote in a July 20 court filing from the IRS said this structure means that the Puerto Rico income “was subject to no U.S. tax and almost no Puerto Rican tax.”

Medtronic disagrees with the IRS’ view. And after a six-week trial featuring nearly 70 witnesses, the Tax Court judge largely agreed with Medtronic.

The IRS “belittles MPROC’s role,” Tax Court Judge Kathleen Kerrigan wrote. “MPROC was an integral part of [Medtronic]. It not only made the finished product, it made sure that the finished product was safe and could be implanted in a human body. MPROC’s role was not only to make a safe product but to make a product that would stand the test of time.”

Jason Fritts, a Minneapolis-based senior manager for transfer pricing with accounting and advisory firm Eide Bailly, noted that the conflict between Medtronic and the IRS was complicated by the fact that the two sides had a written “memorandum of understanding” (MOU) spelling out the royalty rates long before the dispute went to court.

Court filings say the two sides negotiated the MOU agreement to resolve an audit of Medtronic’s 2002 taxes. The compromise stood until the audit of Medtronic’s 2005 taxes. It’s not clear why the agreement was eventually set aside. The IRS accused Medtronic of violating it by failing to report royalty income, but Fritts said the court filings raise questions about how the IRS can go back on such a deal.

After setting aside the agreement, the IRS analyzed Medtronic’s 2005 filings and decided to use a different statistical method for estimating the value of the intangibles provided to MPROC than was spelled out in the MOU. The new method increased Medtronic’s U.S. taxable income by roughly $550 million in 2005 and $810 million the next year.

“The IRS came in and said, ‘we want to use a different method,’ ” Fritts said. “And that’s the thing. The MOU agreed on a specific methodology to calculate these royalty rates. And the IRS came back and said ‘No, we want to use a different methodology, and using that methodology you owe a much greater royalty payment.’ ”

In the end, Judge Kerrigan rejected the IRS methodology and reverted to the original method but with different inputs, resulting in a ruling that increased Medtronic’s taxable income by just $29 million, instead of $1.4 billion. “We hold that [Medtronic] has met its burden of showing that [the IRS’] allocations were arbitrary, capricious, or unreasonable,” she concluded.