A federal judge has ruled that Qualcomm unlawfully squeezed out rivals in the cellphone chip market and charged excessive royalties to cellphone manufacturers such as Apple.

The decision issued Tuesday vindicates the U.S. Federal Trade Commission two years after it filed its antitrust lawsuit. It’s a potentially costly setback for Qualcomm that undercuts a key piece of its business.

The tech giant operates an R&D facility in the Triangle.

It also may be one of the companies hurt when trade sanctions against China tech firm Huawei take effect.

U.S. District Judge Lucy Koh in San Jose, California, ruled that Qualcomm must renegotiate licensing deals with customers. The San Diego company must license its patents to rival chip makers at fair prices and can’t sign exclusive supply agreements with smartphone makers like Apple that block competitors from access to that market. Qualcomm must submit to monitoring for the next seven years to make sure it follows the order.

The outcome seems likely to reduce the licensing fees paid on the sales of smartphones, but it’s unclear if the device makers will pass on any of their savings and lower their prices. The royalties represent a relatively small portion of smartphone prices that now top $1,000 for some premium models.

Qualcomm Inc. said Wednesday that it will appeal.

“We strongly disagree with the judge’s conclusions, her interpretation of the facts and her application of the law,” Qualcomm general counsel Don Rosenberg said in a statement.

Qualcomm justified its “no license, no chips” system as a way to be repaid for the $40 billion it has spent through several decades working on wireless technology essential to smartphones.

Last month Apple and Qualcomm settled a bitter financial dispute centered on some of the technology that enables iPhones to connect to the internet. The deal requires Apple to pay Qualcomm an undisclosed amount. It also includes a six-year licensing agreement that likely involves recurring payments to the mobile chip maker.

Apple had already lost an earlier battle with Qualcomm in March when a federal court jury in San Diego decided the iPhone maker owed Qualcomm $31 million for infringing on three of its patents.

Qualcomm shares dropped nearly 11%, to $69.38, in morning trading.