Robin Thicke and Pharrell Williams were ordered to pay $5 million to Marvin Gaye’s family for the copyright of Thicke’s 2013 hit single, “Blurred Lines,” after a 5-year legal battle.

The songwriters were accused of copyright infringement due to the song’s similarities to Gaye’s 1977 hit, “Got To Give It Up.” The pair were ordered to pay $7 million in 2015, but it was reduced to $5.3 million after they appealed.

In March, the 9th Circuit Court of Appeals affirmed the verdict which cleared T.I., who was also featured on the song, and Interscope Records, which is the label it was released under.

Thicke, Williams and Williams’ distributing company were required to pay the estate’s damages of almost $2.9 million. Thicke additionally was arranged to pay more than $1.7 million and Williams and his distributing company must pay $357,631 to Gaye’s home. Gaye’s family will likewise get pre-judgment enthusiasm on the harms and 50% of the royalties from “Blurred Lines.”