The long drawn-out copyright battle over Robin Thicke’s 2013 song “Blurred Lines” has ended after a judge ordered Thicke and Pharrell Williams to pay almost $5 million to Marvin Gaye’s estate in the case’s final ruling.

Members of Gaye’s family sued Thicke and Williams, along with rapper and featured artist on the song, T.I., in 2013 for copyright infringement of Gaye’s 1977 hit song “Got to Give It Up.”

In 2015, the Gaye family won their case. The court ordered Thicke and Williams to pay Gaye’s estate more than $7 million dollars, an amount that was later reduced to $5.3 million.

Thicke and Williams appealed the verdict, and in March of this year a judge mostly upheld the jury’s decision.

In a Dec. 6 ruling, a judge in the Central District of California reaffirmed the March ruling, declaring Thicke, Williams, and More Water From Nazareth Publishing must pay Gaye’s estate $2.9 million in damages.

Thicke was ordered to pay an additional $1.76 million dollars, while Williams and his publishing company must each pay Gaye’s estates separate rewards of $357,630.

T.I. was cleared of any liability in March, a decision upheld in this last and final verdict.

The Gaye estate was also rewarded half of the song’s running royalties from after the court’s original judgment date, and interest of 0.25% based on the 2015 decision.

The Central District’s verdict finishes a legal battle followed by much of the music industry. In 2016, more than 200 musicians, including Jennifer Hudson and Hans Zimmer, filed an amicus brief in support of Thicke and Williams appeal, claiming the verdict would be “very dangerous” to the music industry.

Since the Gaye family first filed their lawsuit, other high-profile artists like Lana Del Rey and Mark Ronson have been similarly sued.