Epic Games, the maker of the widely popular video game Fortnite, which is played by about 400 million people worldwide, challenged Apple’s app store restrictions.

Apple has been charging commissions of up to 30 percent on digital transactions within apps through the company’s own in-app payment options. The transactions cover a wide range of purchases, including Netflix or Spotify subscriptions and buying digital items such as songs, movies or microtransactions in video games.

U.S. District Judge Yvonne Gonzalez ruled that the company must allow developers to put “buttons, external links, or other calls to action that direct customers to purchasing mechanisms” in their apps, circumventing the commission fee. The ruling could potentially save app developers billions of dollars and encourage them to lower prices paid by consumers.

Epic also attempted to challenge Apple as a monopoly, but Gonzalez said the company failed to properly demonstrate the argument.

“Today the Court has affirmed what we’ve known all along: the App Store is not in violation of antitrust law. As the Court recognized ‘success is not illegal.’ Apple faces rigorous competition in every segment in which we do business, and we believe customers and developers choose us because our products and services are the best in the world,” Apple said in a statement after the ruling.

For more reporting from the Associated Press, see below.

Apple shares dipped sharply immediately after the issuance of the ruling and was trading down 3 percent Friday. Epic, based in Cary, North Carolina, is a private company.

Epic cast that highly lucrative fee as a price-gouging tactic that wouldn’t be possible if competing stores were allowed to offer iPhone apps.

An appeal of the ruling by one or both companies seems likely.

The 185-page ruling issued Friday by Rogers comes three months after the conclusion of a trial focused on one of the pillars holding up Apple’s $2 trillion empire—one that Apple’s late co-founder Steve Jobs began to shape 20 years ago.

Since that trial ended, Apple has taken two steps to loosen some of its app store rules—one to settle a lawsuit and another to appease Japanese regulators without altering its commissions. Those concessions make it easier for many apps to prod their users to pay for digital transactions in ways that avoid triggering Apple’s fees.