Katy Perry will no longer have to pay $2.8m (£2.1m) to a rapper who said she stole his song on her hit Dark Horse.
Marcus Gray sued Perry in 2014, saying she had plagiarised an eight-note riff from his track Joyful Noise.
A jury agreed and awarded him the $2.8m payout, but a judge later overturned that verdict, saying the melody was not "particularly unique or rare".
Upholding that decision, an appeals court said the original verdict could have suffocated musical creativity.
In a 3-0 verdict, the court said Gray had been attempting to claim an "improper monopoly" over conventional "musical building blocks" when he first sued Perry in 2014.
"The trial record compels us to conclude that the ostinatos at issue here consist entirely of commonplace musical elements, and that the similarities between them do not arise out of an original combination of these elements," the new ruling reads.
"Allowing a copyright over this material would essentially amount to allowing an improper monopoly over two-note pitch sequences or even the minor scale itself, especially in light of the limited number of expressive choices available when it comes to an eight-note repeated musical figure."
The ruling brings the eight-year trial to an end, barring an unlikely trip to the US Supreme Court.
The verdict will be read with interest by lawyers for Ed Sheeran, who is facing similar claims of plagiarism in the UK High Court.
The star is also accused of stealing an eight-note phrase from an unknown rapper, in this case the UK grime acts Sami Switch.
Switch, whose real name is Sami Chokri, claims that the "oh I, oh I, oh I" hook of Sheeran's song Shape Of You has a "striking similarity" to the chorus of his 2015 single Oh Why.
Sheeran denies the allegation, and told the court he had never heard Chokri's song before he made his claim.
Unusually, Sheeran and his co-writers Johnny McDaid and Steve Mac took pre-emptive legal action, asking the High Court to declare they had not infringed Chokri's copyright.
Several months later, Mr Chokri and his co-writer Ross O'Donoghue issued their own claim for "copyright infringement, damages and an account of profits in relation to the alleged infringement".
Giving evidence on Thursday, Steve Mac said the case was "not about money" but "to clear my name".
He told the court that working with Sheeran on Shape Of You was an "extraordinary experience", as the song came together "from scratch" at "extraordinary speed".
"I had a headache at the end of the day," he said, adding: "It was the first time I had written with anyone like this. It was incredible."
Andrew Sutcliffe QC, representing Mr Chokri and Mr O'Donoghue, suggested the spontaneity was an illusion, because Sheeran had "already worked out how he wanted this song to sound" and "already had lyrics and ideas which he was able to deploy at speed".
Mr McCutcheon disagreed, adding: "The speed that [Sheeran] writes is extraordinary to the point that we can write 26 songs in a week."
The trial, which is due to last three weeks, will hear from Mr Chokri next Monday.
Dua Lipa and Sam Smith sued
Claims of plagiarism are as old as pop music itself.
Even former Beatle George Harrison was found guilty of "subconsciously copying" elements of his 1970 hit My Sweet Lord from The Chiffons' He's So Fine, and ordered to pay that song's composers $1.6m ($8m in today's money).
There has been an upward trend in cases since the infamous Blurred Lines case of 2015, in which Robin Thicke and Pharrell Williams were found guilty of copying the "feel" of Marvin Gaye's Got To Give It Up, rather than directly plagiarising musical phrases or lyrics.
Many cases are settled out of court, with composers quietly added to the credits of songs behind the scenes.
The number of writers on Mark Ronson and Bruno Mars's Uptown Funk ballooned from six to 11 when The Gap Band noticed similarities to their song Oops Upside Your Head.
Last year, Olivia Rodrigo added two members of Paramore to the writing credits of Good 4 U, after fans started creating mash-ups of her hit and Paramore's musically-similar Misery Business.
In the last week, both Dua Lipa and Sam Smith have been hit with copyright lawsuits of their own.
Lipa has been sued twice over her song Levitating - the biggest-selling single in the US last year.
Songwriters L Russell Brown and Sandy Linzer said the opening melody of Levitating was a "duplicate" of their 1979 song Wiggle and Giggle All Night and the 1980 song Don Diablo (they apparently didn't mind copying their own material).
The Florida reggae band Artikal Sound System launched a separate legal action, saying the chorus was ripped off from their 2017 song Live Your Life.
Sam Smith and Normani are also facing a trial over their duet Dancing With A Stranger, with three songwriters saying that both the song and its video contained "extraordinary similarities" to their song, also called Dancing With A Stranger.
"In both songs, the title, hook, chorus, lyrics, and musical composition are all the same - and are repeated throughout the song giving both songs their identities," said Jordan Vincent, Christopher Miranda and Rosco Banlaoi in a complaint filed in Los Angeles.