A federal appeals court ruled Monday that Josh Groban’s 2003 song “You Raise Me Up” didn’t infringe the copyright to a little-known 1977 song, ruling that both songs were actually derived from the century-old folk song “Danny Boy.”

Ending a three-year legal battle over Groban’s first big hit, the U.S. Court of Appeals for the Ninth Circuit upheld a lower judge’s decision last year: That any similarities between the two songs originated in the famous folk ballad, for which any copyright has long since expired.

The ruling came in a lawsuit filed in 2018 by a company called Johannsongs-Publishing Ltd., which owns the rights to a 1977 song entitled “Söknuður.” The case claimed that “You Raise Me Up,” written by Irish-Norwegian band Secret Garden but popularized by Groban’s version, was “97% similar” to the earlier song.

The lawsuit named Secret Garden member and songwriter Rolf Løvland as a defendant, as well as Universal Music Group, Warner Music Group, Spotify and Apple. Groban, who merely covered the song, was never a party to the lawsuit.

Last year, a federal trial judge dismissed the case. Citing a report prepared by famed New York University musicologist Lawrence Ferrara, the judge ruled that the similarities between the two songs were derived from so-called prior art — a legal term referring to a third, pre-existing piece of music.

In this case, that song was “Danny Boy,” the mournful 1913 English ballad set to the melody of the even-older Irish folk song “Londonderry Air.”

“Any melodic similarities between ‘Soknudur’ and ‘Raise’ are either unprotectible because they are found in prior art songs including ‘Londonderry Air’ aka ‘Danny Boy,’ or they are too scattered to amount to substantial similarity,” wrote U.S. District Judge André Birotte Jr. in his April 2020 decision.

In seeking to overturn that ruling, Johannsongs argued on appeal that Judge Birotte had unfairly excluded a report from the company’s own expert, another well-known musicologist named Judith Finell. The judge did so on the grounds that Finell failed to properly “filter” unprotectable elements when comparing the two songs.

But on Monday, the Ninth Circuit said Judge Birotte had made the proper decision and “did not abuse its discretion in excluding Finell’s expert reports because they failed to filter out similarities that are attributable to prior art, as required.”

Barry Slotnick, an attorney at the law firm Loeb & Loeb who represented UMG and the other defendants, told Billboard on Tuesday (Nov. 30) that he and his clients were “quite pleased that the Ninth Circuit recognized and upheld the well-considered decision of the district court judge.” An attorney for Johannsongs did not return a request for comment.

The ruling will fully end the lawsuit, barring a reversal by the full Ninth Circuit or a trip to the U.S. Supreme Court, which are both very unlikely.