Qualcomm Inc persuaded a US appeals court to set aside a 2019 ruling that cast a pall over its licensing business and threatened to upend the smartphone industry.

The ruling early this week by a three-judge panel is a blow to the Federal Trade Commission, which last year won an order requiring the company to renegotiate patent licenses worth billions of dollars with phone makers.

Qualcomm climbed more than 5% on the news, and shares were trading at $110.65 at 12:33pm in New York.

The FTC had no immediate comment and Qualcomm didn’t immediately respond to a request for comment.

If the ruling brings an end to the FTC case against Qualcomm, it’ll represent the end of years of legal and regulatory entanglements for the largest maker of chips that run smartphones. In July, Qualcomm announced that China’s Huawei Technologies Co has signed a licensing deal and paid up on withheld patent fees. That agreement has brought Huawei, the last major holdout, into the list of Qualcomm’s customers.

In May 2019, US District Judge Lucy Koh in San Jose, California, sent Qualcomm’s shares tumbling when she ruled the company was charging phone makers “unreasonably high” licensing fees and thwarting competition. She ordered the chipmaker to negotiate licensing agreements with customers “in good faith” and without threatening to cut off access to its products. Koh’s order was put on hold pending appeal.

Qualcomm argued on appeal that its licensing business benefits the whole industry by speeding up improvements to smartphones and the services they support. The company emphasised that it doesn’t stop rival chipmakers from accessing its technology. Instead, fees are charged to phone makers who pay a percentage of the selling price of each handset.

The FTC case, filed in 2017, is among numerous challenges to Qualcomm’s practices from competitors, customers and regulators worldwide. The San Diego-based company has weathered most of those, winning in court or settling, and maintained its right to charge the fees. Koh’s ruling has been the biggest remaining challenge to the licensing model.

In a rare split among antitrust regulators, the US Justice Department lined up with Qualcomm against the FTC, arguing that Koh’s ruling could undermine American leadership in technologies including 5G wireless networks.

Qualcomm’s licensing practices aren’t anticompetitive because “Qualcomm is under no antitrust duty to license rival chip suppliers,” the appeals court ruled. If Qualcomm was breaching its obligation to license patents on fair and reasonable terms, that issue belongs with contract and patent law, not antitrust law.

The panel also said that Qualcomm’s “no license, no chips” policy does “not impose an anticompetitive surcharge on rivals’ modem chip sales,” nor does it undermine competition in the market.