Silvio Berlusconi’s Mediaset, Italy’s largest commercial broadcaster, and Vivendi, the parent company of Universal Music Group and Canal Plus Group, have reached an agreement to settle their legal spat over their failed pay-TV deal.

Both companies, along with Fininvest, Berlusconi’s holding company, have agreed to waive all ongoing disputes between them. Under the pact, Vivendi will sell its 19.19% stake in Mediaset over a five-year period through a trust called Simon Fiduciaria.

Fininvest will then buy 5% of Vivendi’s stake in Mediaset at an ex-dividend price of €2.70 per share. The agreement will see Vivendi remain a shareholder of Mediaset with a residual 4.61% stake, which it will have the possibility to retain or sell at any time. Mediaset shareholders, meanwhile, will vote on an extraordinary dividend.

Vivendi also stated that it will “support Mediaset’s international development by voting in favor of the transfer of Mediaset’s headquarters to the Netherlands.” Vivendi and Mediaset have entered a “good neighborhood agreement” in free-to-air television for a five-year term. The settlement deal is scheduled to close on July 22.

The bitter legal spat between the two European companies started in July 2016 after Vivendi back-tracked on a deal to
acquire Mediaset’s pay-TV unit in a share swap valued at about $1 billion. Mediaset sued for breach of contract, claiming damages then estimated at €50 million per month — stemming from the drop in share price — for every month of delay. The dispute escalated when Vivendi started ramping up its stake in Mediaset to nearly 30% in the wake of the failed deal, becoming the company’s second shareholder after Berlusconi’s family.

Mediaset filed a suit in 2017 claiming Vivendi plotted to drive down Mediaset’s share price by premeditating to dishonor their 2016 deal to buy its pay-TV unit Mediaset Premium, and then allegedly used the devaluation caused by the botched deal to raid Mediaset stock.

But a Milan court recently dismissed Mediaset’s claims (for as much as $3.6 billion in damages) against Vivendi, saying that Vivendi’s stake acquisition did “not constitute the contested conduct of unfair competition,” according to Bloomberg. Separately, Italian prosecutors indicted Vivendi’s former chairman Vincent Bolloré and current CEO Arnaud de Puyfontaine last December in a probe over alleged market manipulation. Vivendi has denied any wrongdoing.