Samsung and Apple are still fighting it out in the U.S., and the country's top court has just ruled in the Galaxy maker's favor.

The U.S. Supreme Court has ruled in Samsung's favor in its ongoing design patent war with Apple, throwing out an earlier ruling that Samsung would have to pay the iPhone maker $399 million for infringing on its design patents, and giving Samsung a chance to win back some of the damages awarded to its rival. The justices voted 8-0 that Samsung's patent infringement could only affect a component of an infringed product — i.e. the iPhone's distinctive appearance — and not the sum total of its parts.

The ruling gives Samsung another chance to win back $399 of the $548 million awarded to Apple. That figure has already been whittled down on appeal from the $930 million originally awarded in 2012. Samsung argued that the infringing parts in certain Galaxy phones played a small role in its products' success, and thus it shouldn't have to hand over all of its profits from these devices.

As Reuters reports, the argument centered on the definition of "article of manufacture" in U.S. law, and whether it related to the entire product, or just specific components.

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.

Justice Sonia Sotomayor, writing for the unanimous court, said that the patent 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.

The case will now return to a lower court to calculate the (new) portion of profits that Samsung must pay Apple.