DADO RUVIC/REUTERSA Samsung logo and a logo of Apple are seen in this September 23, 2014 illustration photo.

After nearly five days of deliberations, a US jury on Thursday said Samsung Electronics Co. Ltd should pay $539 million (£403.26 million) to Apple Inc. for copying patented smartphone features, according to court documents, bringing a years-long feud between the technology companies into its final stages.

The world’s top smartphone rivals have been in court over patents since 2011, when Apple filed a lawsuit alleging Samsung’s smartphones and tablets “slavishly” copied its products. Samsung was found liable in a 2012 trial, but a disagreement over the amount to be paid led to the current retrial over damages where arguments ended on May 18, Reuters reported.

Samsung previously paid Apple $399 million to compensate Apple for infringement of some of the patents at issue in the case. The jury has been deliberating the case since last week.

Because of that credit, if the verdict is upheld on appeal it will result in Samsung making an additional payment to Apple of nearly $140 million.

In a statement, Apple said it was pleased that the members of the jury “agree that Samsung should pay for copying our products.”

“We believe deeply in the value of design,” Apple said in its statement. “This case has always been about more than money.”

Samsung did not immediately say whether it planned to appeal the verdict but said it was retaining “all options” to contest it.

“Today’s decision flies in the face of a unanimous Supreme Court ruling in favor of Samsung on the scope of design patent damages,” Samsung said in a statement. “We will consider all options to obtain an outcome that does not hinder creativity and fair competition for all companies and consumers.”

The new jury verdict followed a trial in San Jose, California, before Judge Lucy Koh that focused on how much Samsung should pay for infringing Apple patents covering aspects of the iPhone’s design. The jury awarded Apple $533.3 million for Samsung’s violation of so-called design patents and $5.3 million for the violation of so-called utility patents.

Apple this year told jurors it was entitled to $1 billion in profits Samsung made from selling infringing phones, saying the iPhone’s design was crucial to their success.

Samsung sought to limit damages to about $28 million, saying it should only pay for profits attributable to the components of its phones that infringed Apple patents.

Jurors in the earlier trial awarded $1.05 billion to Apple, which was later reduced.

Samsung paid $548 million to Apple in December 2015, including $399 million for infringement of some of the patents at issue in this week’s trial.