It threw out an appeals court ruling demanding Samsung pay a $399million (£313million) penalty to its American rival for copying key iPhone designs.

The decision gives Samsung another chance to try to get back a big chunk of the money it paid Apple in December, following a 2012 jury verdict that it infringed Apple's iPhone patents and mimicked its distinctive appearance in making the Galaxy and other competing devices.

The court 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.

WAR MACHINE?

SUPER SLATE

CELESTIAL SHOW

Stunning Super Worm Moon to light up UK sky tonight - here's how to spot it

The ruling followed a ferocious legal battle between the world's top two smartphone manufacturers that began in 2011 when Apple sued Samsung, asserting that its rival stole its technology and the iPhone's trademarked appearance.

It was one of the most closely watched patent cases to come before the top U.S. court in recent years.

Samsung had been seeking to pare back $399million of $548million it paid Apple in December following a 2012 jury verdict finding that it infringed Cupertino, California-based Apple's iPhone patents and copied its distinctive appearance.

After a trial in 2012, Apple was awarded nearly $930million in damages. The U.S. Court of Appeals for the Federal Circuit in Washington in May 2015 upheld the patent infringement verdict, but said the iPhone's appearance could not be protected through trademarks, cutting Samsung's damages back by $382million.

But it took the matter to the Supreme Court, saying it should not have had to make $399million 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.

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 on phones that infringed iPhone design patents, saying those elements contributed only marginally to a complex product with thousands of patented features.

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

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

We pay for your stories! Do you have a story for The Sun Online news team? Email us at tips@the-sun.co.uk or call 0207 782 4368