Google and Microsoft have agreed to end a five-year battle over patents, with both dropping around 20 lawsuits in the US and Germany.

As part of the deal, the companies will dismiss all pending patent infringement litigation between them, including cases related to Motorola Mobility.

The companies did not disclose the financial terms of the deal.

Separately, the companies have agreed to collaborate on several patent matters and expect to work together in other areas in the future.

Both the companies have been suing each other over patents since 2010, beginning with a patent lawsuit related to Motorola. Google came into the case when it acquired Motorola Mobility in 2011.

Google sold Motorola to Lenovo and has retained the company’s patents, and its interest in several cases.

Microsoft alleged that Google’s Android mobile operating system infringed several of its patents. Motorola was accused of breaching the software firm’s obligation to fairly license its wireless and video patents used in Xbox systems.

A Microsoft spokeswoman told Reuters that as Microsoft and Google continue to make products that compete directly with each other, the latest agreement does not preclude any infringement lawsuits in the future.