Katy Perry’s smash hit Dark Horse was not copied from a Christian rap song, a US judge has ruled.

The ruling overturns a jury’s verdict from last summer, which said Perry’s song lifted an eight-note riff from Flame’s 2009 song Joyful Noise.

In her decision, US district judge Christina A Snyder said the sequence of notes was “not a particularly unique or rare combination”.

As a result, Perry’s team no longer owe Flame $2.8m (£2.3m) in damages.

Snyder drew on the testimony of the rapper’s own witness, musicologist Todd Decker, in concluding the jury had reached the wrong verdict.

“A relatively common eight-note combination of unprotected elements that happens to be played in a timbre common to a particular genre of music cannot be so original as to warrant copyright protection,” she wrote.

Perry’s lawyer Christine Lepera had made a similar argument during the trial, saying that Flame was “trying to own the basic building blocks of music”.

She welcomed Judge Snyder’s ruling, calling it “an important victory for music creators and the music industry”.