Ailing Nokia said on Tuesday it had ended a legal battle with Apple, which will pay an undisclosed one-off fee and ongoing royalties to the Finnish firm.

The agreement will result in settlement of all patent litigation between the companies, including the withdrawal by Nokia and Apple of their respective complaints to the U.S. International Trade Commission, Nokia said.

Nokia said the deal would boost its second-quarter earnings, but said specific terms were confidential.

Legal battles have become increasingly common in the cellphone industry since Apple and Google carved out a large chunk of the lucrative and quickly expanding smartphone market at the expense of older players.

(Reporting by Tarmo Virki; Editing by David Cowell)