SAN FRANCISCO (AP) — A federal appeals court has overturned an antitrust ruling against Qualcomm, dismissing arguments that it unlawfully squeezed out cellphone chip rivals and charged excessive royalties to manufacturers such as Apple.

The 3-judge panel unanimously sided with the San Diego chipmaker in tossing out a district court’s earlier ruling on a lawsuit brought by the U.S. Federal Trade Commission.

It’s a victory for Qualcomm, since the earlier ruling could have undercut its business by threatening its ability to extract big royalties from phone makers.

“Anticompetitive behavior is illegal under federal antitrust law. Hypercompetitive behavior is not,” said the opinion Tuesday from the Ninth Circuit Court of Appeals, which described the earlier ruling as going beyond the scope of antitrust law.

U.S. District Judge Lucy Koh in San Jose, California, ruled in May 2019 that Qualcomm must renegotiate licensing deals with customers. Her ruling would have required Qualcomm to license its patents to rival chipmakers at fair prices and refrain from signing exclusive agreements that block competitors from also selling chips to smartphone makers. Qualcomm would have had to submit to FTC monitoring for seven years.

The case pitted the U.S. government against itself. While the FTC pursued its charges in court, the Justice Department told the appellate court that Koh’s decision would endanger national security by diminishing Qualcomm’s competitiveness.

Qualcomm said in a statement Tuesday that the appeals court ruling “validates our business model and patent licensing program and underscores the tremendous contributions that Qualcomm has made to the industry.”