Nokia Oyj, the Finnish mobile-phone maker struggling to reverse a slide in sales, agreed to a patent-licensing deal with BlackBerry maker Research In Motion, ending all legal disputes between the companies.

RIM will make a one-time and “on-going” payments to Nokia, the Espoo, Finland-based company said Friday.

The agreement includes a “one-time payment and on-going payments, all from RIM to Nokia,” Nokia said, but did not disclose “confidential” terms.

Nokia is trying to add revenue from its patent portfolio as sales at its unprofitable smartphone unit drop. It may get a one-time payment of $150 million to $200 million, and about $50 million annually over the next 10 to 15 years, depending on when the patents expire, according to estimates by Hannu Rauhala, an analyst at Pohjola Bank Oyj in Helsinki.

Nokia has sold units and assets including its headquarters to boost its cash position. Its cash reserves have shrunk by about half in the past five years and will drop below 3 billion euros by year-end, Standard & Poor’s estimated in August. Its debt is at junk status at the three main rating companies.

“The impact of this deal is twofold: on the one hand, it shows the upside potential for Nokia to cash in from similar legal cases,” Sami Sarkamies, an analyst at Nordea Bank AB in Helsinki, said by phone today. “Secondly, the financial impact will help Nokia beef up its cash position and bring in new revenues that give Nokia time to turn its loss-making smartphone unit around.”

Sarkamies estimated that Nokia may receive no more than 100 million euros ($132 million) annually from RIM for probably a five-year period, and that the one-time payment could be several hundred million euros.

In May, Nokia said it filed patent-infringement lawsuits against Waterloo, Ontario-based RIM, HTC Corp. and ViewSonic Corp. over inventions in mobile devices including phones and tablets. The RIM deal signals that the disputes with HTC and ViewSonic could be settled within six months, Sarkamies said.

The agreement is less lucrative than the one Nokia signed with Apple Inc. last year because RIM’s device volumes are “so small and the BlackBerry maker is going through such difficult times,” he said.

RIM said Thursday that BlackBerry shipments slumped to 6.9 million last quarter. Its PlayBook tablet shipments were 255,000.

Both Nokia and RIM are struggling to compete with Apple’s iPhone and smartphones using Google Inc.’s Android software, including those from market leader Samsung Electronics Co. Android and Apple accounted for 90 percent of global smartphone shipments last quarter, compared with 4.3 percent for the BlackBerry and less than that for Nokia, according to research firm IDC.

Last month, Nokia sued the Blackberry maker for breach of contract in Britain, the United States and Canada over cellular patents they agreed in 2003. RIM claimed the license — which covered patents on “standards-essential” technologies for mobile devices— should also have covered patents for non-essential parts, but the Arbitration Institute of Stockholm Chamber of Commerce ruled against RIM’s claims.

Major manufacturers of phones and wireless equipment are increasingly turning to patent litigation as they jockey for an edge to expand their share of the rapidly growing smartphone market.

Nokia is among leading patent holders in the wireless industry. It has already received a $565 million royalty payment from Apple Inc. to settle long-standing patent disputes and filed claims in the United States and Germany alleging that products from HTC Corp. and Viewsonic Corp. infringe a number of its patents.

[RIM also operates a research and development office in the Research Triangle Park, N.C. area.] 

(Bloomberg and The AP contributed to this report.)