In a long pending battle between Samsung and Apple over patent infringement, the US Supreme Court has ruled in favour of the Korean smartphone maker who will now not have to pay Apple $399m (£315m) for allegedly copying mobile technology from the competitor.

The case dating back to 2011 was initiated by Apple when the iPhone maker sued Samsung over hardware and software design, including the use of a grid of icons on its user interface for smartphones.

After many rounds of trials, Apple managed to score wins from two lower courts that ordered Samsung to pay its entire profits of $399m earned by using these infringed technologies found on 11 different smartphone models.

However, considering only parts of hardware and software inputs used on these models were copied, the company need not pay the entire amount of profits earned by selling them, the latest ruling says.

"Samsung's damages shouldn't amount to the total sale of the products at issue, given the fact that the dispute only applied to pieces of the product, rather that the whole," said the ruling.

The case has been referred back to the lower courts to assess the final damages Samsung will pay Apple. Vindicated, a Samsung spokesperson told TechCrunch, "The US Supreme Court's landmark decision today is a victory for Samsung and for all those who promote creativity, innovation and fair competition in the marketplace."

The Korean giant's stance in this case has often been backed by other Silicon Valley giants like Google, Facebook, eBay and HP who say penalties for such cases should be proportionate to the importance of the features that have been infringed.

Meanwhile, Apple also issued a statement post the ruling, saying, "We will continue to protect the years of hard work that has made iPhone the world's most innovative and beloved product. We remain optimistic that the lower courts will again send a powerful signal that stealing isn't right."