Robin Thicke and Pharrell Williams copied one of Marvin Gaye's songs to create their 2013 smash Blurred Lines, an appeal court has ruled.

The court upheld a 2015 verdict against the stars, which means Gaye's family will get to keep a $5m (£3.5m) payout.

In addition, the family will receive 50% of future royalties from Blurred Lines.

Yet one judge dissented from the verdict, saying the two songs "differed in melody, harmony and rhythm".

Circuit Judge Jacqueline Nguyen added that the ruling "strikes a devastating blow to future musicians and composers everywhere".

In the original 2015 trial, a jury found that Blurred Lines had copied Gaye's 1973 hit Got To Give It Up - despite many observers claiming the songs were only similar in feel, rather than composition.

Thicke, Williams and rapper TI, who contributed a verse to the track, launched an appeal in 2016 and were backed by 212 fellow songwriters, among them John Oates, Jason Mraz and members of Linkin Park.

They argued the verdict "threaten[ed] to punish songwriters for creating new music that is inspired by prior works."

But the 9th US Circuit Court of Appeals largely upheld the decision, while clearing TI - real name Clifford Harris Jr - of any copyright infringement.

The judges rejected Williams and Thicke's request to order a new trial, saying Gaye's copyright was entitled to broad protection.

They also accepted the original judge's decision to instruct the jury to reach their verdict based only on the sheet music to the songs and not the recordings.

You can see the full ruling here.

Wednesday's decision prompted a strong dissent from Circuit Judge Jacqueline Nguyen.

She said the decision let the Gayes "accomplish what no one has before: copyright a musical style" and expanded the potential for further copyright litigation.

"The Gayes, no doubt, are pleased by this outcome," she wrote. "They shouldn't be.

"They own copyrights in many musical works, each of which (including Got To Give It Up) now potentially infringes the copyright of any famous song that preceded it.

"That is the consequence of the majority's uncritical deference to music experts."

'A victory for musicians'

Howard King, a lawyer for Thicke and Williams, said Judge Nguyen's comment "enhances the prospects" his clients might prevail in an appeal.

"These are two entirely different songs," he said.

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."

Musicologists have reacted with disappointment to the ruling, saying it might hinder creativity in the future.

Joe Bennett, a professor at Berklee College of Music, wrote a note-by-note comparison of the two songs in 2014 and concluded they only shared a groove.

"What they have in common is indicative of the time period," he told Forbes this week.

"If my favourite artist uses a cowbell and I use one too, can you copyright the cowbell? Both are arguing that their side is good for creators.

"That's why so many of the young songwriters are concerned. What's the threshold? How much can I be influenced by my favourite artist?"

'Horrible precedent'

Since the Blurred Lines trial, there have been a number of similar cases against such artists as Bruno Mars, Ed Sheeran, 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.

Meanwhile, Thicke, Williams and TI issued a joint statement about Wednesday's ruling, claiming it set a "horrible precedent".

"Blurred Lines was created from the heart and minds of Pharrell, Robin and TI and not taken from anyone or anywhere else," they said.

"We are reviewing the decision, considering our options and you will hear more from us soon about this matter."