The Supreme Court on Monday ruled 5-4 against Apple, saying iPhone users can pursue their antitrust lawsuit involving the tech giant's signature electronic marketplace, the App Store.

Justice Brett Kavanaugh wrote the majority opinion, which was joined by the court's liberal justices.

The iPhone users argued that Apple's 30% commission on sales through the App Store is an unfair use of monopoly power that results in inflated prices passed on to consumers.

Apple argued that only app developers, and not users, should be able to bring such a lawsuit. But the Supreme Court, in an opinion authored by Kavanaugh, rejected that claim.

Read more: Here's how the Supreme Court's Apple App Store decision could affect companies like Amazon and Google

"Apple's line-drawing does not make a lot of sense, other than as a way to gerrymander Apple out of this and similar lawsuits," Kavanaugh wrote.

Shares of Apple, already battered by trade concerns, were down 5%, lagging the broader market.

The result was widely expected after arguments in November in the case, Apple v. Pepper, during which the justices seemed skeptical of Apple's arguments.

The case split President Donald Trump's two nominees to the high court. In a dissent joined by his fellow conservatives, John Roberts, Clarence Thomas and Samuel Alito, Justice Neil Gorsuch wrote that the majority created an "artificial rule."

The legal battle over the company's online marketplace has dragged on for nearly a decade.

The result of the iPhone users' litigation could affect the way that Apple, as well as other companies that operate electronic marketplaces like Facebook, Amazon and Alphabet's Google, structure their businesses. For Apple, hundreds of millions of dollars in penalties could hang on the outcome.

In a statement, David Frederick, an attorney for the iPhone users, said the "decision is important for upholding consumer protections against the dangers of monopoly retailers like Apple. Apple's monopoly control has distorted the prices for apps and it's time for that abuse of monopoly power to end."

Apple's full statement is below:

"Today's decision means plaintiffs can proceed with their case in District court. We're confident we will prevail when the facts are presented and that the App Store is not a monopoly by any metric. We're proud to have created the safest, most secure and trusted platform for customers and a great business opportunity for all developers around the world. Developers set the price they want to charge for their app and Apple has no role in that. The vast majority of apps on the App Store are free and Apple gets nothing from them. The only instance where Apple shares in revenue is if the developer chooses to sell digital services through the App Store. Developers have a number of platforms to choose from to deliver their software — from other apps stores, to Smart TVs to gaming consoles — and we work hard every day to make our store the best, safest and most competitive in the world."

Read the court's opinion: