(Reuters) - The U.S. Supreme Court on Tuesday sided with Samsung in its big-money smartphone patent fight with Apple, throwing out an appeals court ruling that the South Korean company had to pay a $399 million penalty to its American rival for copying key iPhone designs.

3D-printed Samsung and Apple logos are seen in this picture illustration made in Zenica, Bosnia and Herzegovina on January 26, 2016. REUTERS/Dado Ruvic

The 8-0 ruling, written by Justice Sonia Sotomayor, held that a patent violator does not always have to fork over its entire profits from the sales of products using stolen designs, if the designs covered only certain components and not the whole thing.

The justices sent the case back to the U.S. Court of Appeals for the Federal Circuit in Washington to determine how much Samsung must pay. But they did not provide a road map to juries and lower courts on how to navigate similar disputes in the future.

Apple spokesman Josh Rosenstock said in a statement that the U.S. company remained “optimistic that the lower courts will again send a powerful signal that stealing isn’t right.”

Samsung told Reuters in a statement the ruling was a “victory for Samsung and for all those who promote creativity, innovation and fair competition in the marketplace.”

Following a 2012 jury verdict favoring Apple, Samsung initially was hit with nearly $930 million in penalties, later cut by $382 million, for infringing Apple’s iPhone patents and mimicking its distinctive appearance in making the Galaxy and other competing devices.

Samsung in December 2015 paid its Cupertino, California-based rival $548 million. But Samsung took the matter to the Supreme Court, saying it should not have had to make $399 million of that payout for copying the patented designs of the iPhone’s rounded-corner front face, bezel and colorful grid of icons that represent programs and applications.

With the products that used iPhone designs, Samsung went on to become the world’s top smartphone maker.

Tuesday’s ruling followed a ferocious legal battle between the world’s top two smartphone manufacturers that began in 2011 when Apple sued Samsung for patent and trademark infringement. It was one of the most closely watched patent cases to come before the top U.S. court in recent years.

The legal dispute centered on whether the term “article of manufacture,” on which design patent damages are calculated in U.S. patent law, should be interpreted as a finished product in its entirety, or merely a component in a complex product.

In court papers, Samsung, Apple and the U.S. government all agreed that the term could mean a component.

But Apple urged the Supreme Court to affirm the appeals court’s ruling because Samsung presented no evidence that the article of manufacture in this case was anything less than its entire smartphone as sold. Samsung, meanwhile, said that it did not have to present such evidence.

Sotomayor, writing for the unanimous court, said that the law is clear. The term “article of manufacture is broad enough to encompass both a product sold to a consumer as well as a component of that product,” she wrote.

PERIOD OF UNCERTAINTY

The justices nevertheless refused to devise a test for juries and lower courts to use to discern what a relevant article of manufacture is in a particular case, a task that could be fraught with difficulty when considering high-tech products.

“No doubt whether with Apple-Samsung, or some other design patent case, we are going to have a period of uncertainty where courts will be trying to formulate a test and what the boundaries are,” Richard McKenna, an expert in design rights at the law firm Foley & Lardner in Milwaukee, said in an interview.

In court papers, Apple said its iPhone’s success was tied to innovative designs, which other manufacturers quickly adopted in their own products. Samsung, in particular, made a deliberate decision to copy the iPhone’s look and many user interface features, Apple said.

Samsung argued that it should not have had to turn over all its profits, saying that design elements contributed only marginally to a complex product with thousands of patented features.

Design patent fights very rarely reach the Supreme Court. It had not heard such a case in more than 120 years.

The case is Samsung Electronics Co, Ltd v. Apple Inc, in the Supreme Court of the United States, No. 15-777.