(Bloomberg) -- Mediaset SpA, Italy’s largest commercial broadcaster, reached an agreement with French media conglomerate Vivendi SE to end an acrimonious, five-year dispute over a scrapped pay-TV deal.

Silvio Berlusconi’s Mediaset and Vivendi -- controlled by French billionaire Vincent Bollore -- agreed to drop all legal disputes across Europe, according to people familiar with the matter. As part of the settlement, Vivendi committed to sell most of a stake built up in a failed takeover attempt in late 2016, said the people, who asked not to be identified since the talks are private.

Vivendi owns about 19% of Mediaset stake via a trust called Simon Fiduciaria and will sell that over the next five years, while Fininvest -- Berlusconi’s holding company -- plans to buy about half of a 9.6% stake owned directly by Vivendi, leaving the French media company with a holding of about 5% in Mediaset, the people said.

Representatives for Vivendi, Mediaset and Fininvest declined to comment.

The two companies have been fighting since July 2016, when the French company walked away from a plan to buy Mediaset’s pay-television unit in a share swap valued at about $1 billion. Mediaset has sought billions of euros in damages from Vivendi for abandoning the deal.

A few months after the deal failed, Vivendi gradually bought almost 30% of Mediaset in a move the Italian company alleged was illegal. Last month, a Milan court ruled against claims by Berlusconi’s companies for as much as 3 billion euros ($3.6 billion) in damages against Vivendi, according to court documents seen by Bloomberg.

The tribunal also said that Vivendi’s stake building did “not constitute the contested conduct of unfair competition” and dismissed the broadcaster’s complaint. Vivendi is also the largest shareholder of Italy’s former phone monopoly Telecom Italia SpA.

Last September, Vivendi also won a court case, allowing it to keep its stakes in both Mediaset and Telecom Italia after European Union judges delivered a blow to Italian rules curbing the power of media moguls.

In another legal dispute, prosecutors alleged Bollore engaged in market manipulation, intentionally driving down Mediaset’s share price and obstructing the work of Italian market regulator Consob, according to a statement last December. Vivendi has denied wrongdoing.

©2021 Bloomberg L.P.