Qualcomm Inc agreed to pay Broadcom Corp $891 million over four years as part of an overall settlement on Sunday that ends all litigation between the two companies.

Qualcomm will pay Broadcom $200 million of that amount in the quarter ending June 30, the companies said.

The agreement will result in the dismissal of all litigation between the companies, including all patent infringement claims in the International Trade Commission and U.S. District Court in Santa Ana, the companies said. Broadcom will also withdraw its complaints to the European Commission and the Korea Fair Trade Commission as part of the deal.

The companies have also granted certain rights to each other under their respective patent portfolios.

The companies have been involved in legal battles, spanning several years and three continents, related to allegations of technology patent infringement and anti-competitive behavior.

While Broadcom has won many of the recent court battles, analysts have long expected both sides to reach an agreement.

(Reporting by Paritosh Bansal; Editing by Muralikumar Anantharaman)