Relativity Media and Netflix have settled their dispute over a lucrative contract, clearing the way for the bankruptcy court supervised sale of the Hollywood studio.

Lawyers for both companies told U.S. bankruptcy court judge Michael Wiles that they have agreed to the terms of a settlement that would resolve disputes over the licensing deal, according to the Wall Street Journal.

“Today’s settlement with Netflix resolves nearly four years of litigation and other disputes that threatened the value of the Relativity estate,” Relativity’s Chief Restructuring Officer Colin Adams said in a statement to Deadline.

Last month, Relativity Media reached an agreement with its unsecured creditors, removing another significant obstacle to the planned bankruptcy sale. The studio declared bankruptcy for a second time in three years and announced it would sell its assets to its largest secured creditor, UltraV Holdings.

Under terms of the settlement announced today, Netflix would pay Relativity about $7.25 million in fees it withheld from the studio, according to a person familiar with the matter.

Netflix would also drop all of its claims and objections and agree to support the transfer its contract to UltraV, which would be able to stream as many as 30 movies on the service. Netflix was seeking millions of dollars in damages from Relativity, claiming the studio had licensed five films to Amazon and Starz in breach of an exclusivity agreement.

The streamer was seeking to collect $5 million in damages for each title Relativity had failed to deliver to Netflix —  a sum that could add up quickly, since Netflix claims it’s owed eight titles in 2017.

“This settlement helps preserve the value of the Relativity estate for creditors, paving the way for the asset sale to UltraV Group,” Adams said. “We look forward to closing the sale to UltraV and winding down the Relativity estate.”

A Netflix spokesperson declined comment on the settlement, and attorneys for the streaming service were not immediately available.