If you can’t beat them, join them.

Apple Inc. executives may have thought of the old idiom as the tech giant settled a long-term dispute with Nokia Corp. on Tuesday and announced new plans to work together. Apple and Nokia both issued statements saying that all litigation between the parties is settled and agreed to a multi-year patent licence deal.

That deal will see Apple pay the Espoo, Finland-based telecommunications firm an undisclosed sum as an upfront cash payment with more revenue to come over the term of the agreement. The tech firms will also be looking to make peace by collaborating in some areas. Nokia will provide “certain network infrastructure product and services to Apple,” and Apple will carry Nokia’s digital health products in its online and retail stores. The two will also explore other collaboration opportunities on digital health initiatives.

For many years, Apple and Nokia have been courtroom adversaries and lawsuits have been fired from both sides. The firms appeared to settle their patent disputes in 2011, settling a patent dispute that also saw Apple making a cash payment with an agreement to pay regular royalties in the future. But in late 2016 a new campaign in the litigation war began, as Apple sued patent assertion entities acting on behalf of Nokia. Nokia directly sued Apple in response, saying it was owed money for its patents put to use in Apple’s products.

In settling the patent dispute out of court, Apple will miss out on its chance to make a wider argument against what some describe as “patent trolls.” Originally, it argued that certain companies are designed to make a business based on the aggressive defense of patents owned by other businesses. It wanted the court to rule that routinely and aggressively suing based on patents owned by others should be illegal.