It may come as a surprise to you that brand-name pharmaceutical companies have been paying generic-drug makers large sums to keep low-cost products off the market. The Federal Trade Commission for years has tried to have the payments declared anti-competitive -- and thus illegal -- but federal courts haven’t gone along.

Until today. The U.S. Supreme Court handed the FTC a major victory by ruling 5-3 that such pay-to-delay arrangements can run afoul of antitrust laws.

This should have been a no-brainer for any court, especially considering the amount of money involved. An FTC study concluded in 2010 that pay-to-delay costs consumers $3.5 billion a year in higher drug prices. Over the last decade, generic drugs have saved consumers more than $1 trillion. That figure could be a lot higher if pay-to-delay were banned. The FTC says 40 such deals were struck in fiscal 2012 alone.

But the legal arguments were complicated, and there was no clear answer, unless you believe, as the FTC does, that drug makers use their lucrative profits to protect patents that should never have been granted in the first place.

First, the legal complications. Today’s decision involved a clash of statutes. Antitrust laws broadly state that one company (or a group of companies) can’t conspire to stop a rival from competing. Patent laws say the opposite -- one company holding a valid patent can keep a rival’s product that violates the patent off the market.

The statutory collision gets worse. Pay-to-delay deals are made to settle patent litigation, which judges should want to encourage. Here’s how it works: A generic-drug maker challenges the validity of a blockbuster drug’s patent. At the same time, the generic maker obtains Food and Drug Administration clearance to sell its version. Once the FDA gives its approval, the brand-name company pays the generic producer to settle the patent case. Often included is a sum of money that keeps the generic copy off the market for a specified number of years, using the claim that such payments protect exclusive rights to a still-valid patent.

If it all sounds like a sham, well, it often is. The litigation and settlements can be part of an elaborate dance the drug companies and the generic makers do to camouflage anti-competitive behavior. Even though they should be adversaries, they were suspiciously on the same side in this case. Jon Leibowitz, the recently departed FTC chairman, spent the better part of his four-year term trying to convince the courts that this convenient alliance was baldly illegal.

The case centered on Androgel, a treatment for low testosterone in men that is made by Solvay Pharmaceuticals Inc. Androgel sales -- $1 billion last year -- were about to plummet 75 percent after the FDA approved a generic form. Faced with the prospect of losing $125 million in yearly profits. Solvay instead paid generic-drug makers as much as $42 million a year to delay their competing versions until 2015, the FTC said in a lawsuit.

The ruling doesn’t necessarily ban pay-to-delay, but only opens the door to lawsuits by wholesalers, retailers, insurers and antitrust enforcers. The justices directed the lower courts to scrutinize such deals for anti-competitive effects.

The Supreme Court decided this one in favor of consumers, as it should have, by essentially picking antitrust law over patent law.

(Paula Dwyer is a member of the Bloomberg View editorial board. Follow her on Twitter.)