Is the long-fought patent battle between Apple and Samsung entering its final act?

The U.S. Supreme Court on Monday agreed to hear the patent case between Apple AAPL and Samsung ssnlf . The court has accepted Samsung’s appeal that it shouldn’t be forced to pay hundreds of millions of dollars in damages to Apple for alleged patent infringement, and says it will hear the case in the term that begins in October.

The Supreme Court’s decision is a major victory for Samsung, which has long argued that Apple’s patents are invalid. The justices will specifically determine whether a $399 million judgement against Samsung for allegedly mimicking certain aspects of Apple’s iPhone design are indeed “slavishly” copying Apple’s products, as the Cupertino, Calif.-based company has said, or if the patents hold no weight.

In its petition to the court in December, Samsung said that the way laws are being interpreted in the Apple case are not “in line with modern times.”

Get Data Sheet, Fortune’s technology newsletter.

“If the current legal precedent stands, it could diminish innovation, stifle competition, pave the way for design patent troll litigation, and negatively impact the economy and consumers,” Samsung added.

In a statement on the decision, Samsung said, “We welcome the Court’s decision to hear our case. We thank the many large technology companies, 37 intellectual property professors, and several groups representing small business, which have supported our position.

“The Court’s review of this case can lead to a fair interpretation of patent law that will support creativity and reward innovation.”

Apple did not immediately responded to a request for comment.

The Supreme Court’s decision, which stands in stark contrast to the one between Oracle and Google, which it kicked back to the lower court, will effectively end a worldwide patent war between the companies.

Both Apple and Samsung have argued that the other copies its designs and concepts, and sued each other from the U.S. to Germany. Apple was dealt its first victory in 2012, when a jury determined in a lower court that Samsung had copied Apple’s designs. Apple had hoped to be awarded $2.75 billion in that case, but its damages were ultimately pared down to $1 billion. After a series of appeals and rulings, that figure was knocked down to $548 million.

In December, Samsung made the somewhat-surprising move to pay the $548 million in damages, with one caveat: It wanted Apple to agree to give the cash back if the patents were deemed invalid or the Galaxy S7 maker were to win a case on appeal. Now the case is in appeal, and the Supreme Court’s ruling will decide the fate of at least a chunk of that cash.

For more about Apple and Samsung, watch:

The $548 million in damages was finally decided by the U.S. Federal Circuit Court of Appeals last year. In August, Samsung’s petition to the court for a new trial was struck down. The decision left Samsung with the option to either pay Apple and move on or appeal to the U.S. Supreme Court. Samsung ultimately chose the latter—and it paid off.

The Supreme Court will analyze Apple’s so-called ‘915 patent, which describes how the pinch-to-zoom feature works on touch devices. While Apple has argued that the patent is valid (part of its damages come from the intellectual property), it has failed to make its case to the U.S. Patent and Trademark Office (USPTO).

To make its case, Samsung challenged the patent’s validity several years ago, forcing the USPTO to review whether the ‘915 patent was indeed “patentable.” After its first review in 2012, the USPTO, which had previously awarded the patent to Apple, determined that it was invalid and should not have been awarded. The USPTO has subsequently reviewed the patent and again found that Apple’s technology wasn’t patentable. Last December, the USPTO’s Patent Trial and Appeal Board issued its final decision on the matter, deeming it invalid.

In response, Apple last year filed an appeal to the Federal Circuit court over that ruling in hopes of keeping its patent and the damages that go with it.

Apple has had similar trouble making its case for other patents it claims Samsung violates. Last month, for instance, the U.S. Court of Appeals for the Federal Circuit ruled in favor of Samsung. The court ruled that Apple’s patents related to turning alphanumeric characters, such as phone numbers, into links, as well as the iPhone’s slide-to-unlock feature, were “obvious”—a term used to describe technologies that should not have been allowed as patents. That case reversed an earlier decision that awarded Apple $120 million in damages for allegedly violating the patents.

Read more: Samsung Will Pay Apple for Damages—But Wants the Cash Back

Now with the Supreme Court in its sights, Samsung will undoubtedly have some supporters. Last July, industry giants including Google GOOGL , Facebook FB , eBay EBAY , and others filed a brief supporting Samsung with the Federal Circuit Court. The companies said in the brief that if Apple’s victory is allowed to stand, the company could engage in similar lawsuits against other technology firms. They feared such a move would negatively impact the development of “useful modern technologies” and “have a devastating impact on companies.”

It’s now time for the Supreme Court to chime in. So get ready: Apple and Samsung are gearing up for their biggest fight yet.