Image copyright Getty Images Image caption Blurred Lines made more than $15m for Pharrell Williams (left) and Robin Thicke

The long-running copyright case over hit song Blurred Lines has finally ended, with Robin Thicke and Pharrell Williams told to pay $5m (£4m).

The ruling concludes a legal battle that began in 2013, when Marvin Gaye's family claimed Blurred Lines copied Gaye's 1977 hit Got to Give It Up.

Gaye's family initially won the case in 2015, but Thicke and Williams appealed.

A California court upheld the verdict in March this year, and the new amended judgement confirms the settlement.

Thicke, Williams and Williams' publishing company More Water From Nazareth are jointly required to pay Gaye's family damages of $2.8m (£2.2m).

Meanwhile, Thicke has been ordered to pay an additional $1.7m (£1.3m), while Williams and his publishing company will pay another $357,630 (£282,296).

In addition, Gaye's family will be entitled to 50% of all future royalties earned by Blurred Lines.

The total payable is $4.98m (£3.9m) - a fraction of the $16.6m (£13m) Williams and Thicke were revealed to have made from the song during the initial trial.

Image copyright Getty Images Image caption Ed Sheeran has been hit by similar claims of plagiarism

The five-year legal battle has been watched closely by the music industry, where copyright cases have multiplied in recent years.

Many felt the original verdict was mistaken, as it punished Thicke's song for copying the "feel" of Gaye's classic - an intangible quality - rather than directly plagiarising musical phrases or lyrics.

The appeal court was also split on this issue, and one of the three judges dissented from the ruling when it was delivered earlier this year.

Circuit Judge Jacqueline Nguyen said the two songs "differed in melody, harmony and rhythm" and wrote that the verdict "strikes a devastating blow to future musicians and composers everywhere".

However, two of Gaye's children, Frankie and Nona, called the decision "a victory for the rights of all musicians".

Their mother Jan added it was a "wonderful recognition of Marvin's creativity and the lasting value of one of his greatest songs".

Since the Blurred Lines trial, there have been a number of similar cases against such artists as Bruno Mars, Ed Sheeran, Mark Ronson, Madonna and Miley Cyrus.

Others have sought to pre-empt any copyright claims - including Taylor Swift, who gifted Right Said Fred a writing credit on her single Look What You Made Me Do after noticing a passing similarity to their hit I'm Too Sexy; and Ed Sheeran, who added the writers of TLC's No Scrubs to his single Shape Of You shortly after its release.

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.