Handset maker Nokia is likely to be paid hundreds of millions of dollars by Apple after victory in a legal wrangle over technology used in its arch-rival's top-selling iPhone.

Nokia, struggling to stem the slide in its cellphone market share and forecast to post losses this quarter and the next, said on Tuesday the deal would boost second-quarter earnings.

Analysts said it was clear the sums involved would be significant, with some experts estimating Apple's one-off payment at $650 million.

Nokia's shares rose as much as 3 percent before closing up 1.58 percent. Analysts welcomed the news and said it would help Nokia concentrate on its core business at a time when it faces huge challenges.

This is the first positive news from Nokia for a long time. They can both focus on their businesses now, and the dispute was settled to Nokia's advantage, said Mikael Rautanen, analyst at Inderes in Helsinki.

With the deal, Nokia avoids protracted litigation and disruption at a time when the management needs to focus 100 percent on its core business given the current difficulties, said Ben Wood, head of research at CCS Insight.

Earlier this week Nomura forecast Nokia would lose its position as the world's largest smartphone maker this quarter to Samsung Electronics and that Apple would surpass it next quarter.

Nokia warned on second quarter sales and profits at the end of May, abandoning hope of meeting key targets just weeks after setting them and raising questions over whether new CEO Stephen Elop can deliver on the turnaround he promised.

Most analysts said Nokia could get around 1 percent of iPhone revenue, seen at around $43 billion this year according to a Reuters poll, with highest estimates reaching 2 percent.

Strategy Analytics said Apple had so far sold iPhones worth $65 billion, indicating a one-off payment of $650 million if the rate is 1 percent.

The settlement has been reached surprisingly fast, indicating Nokia had a robust case, said Neil Mawston from Strategy Analytics.

Nokia, once the ubiquitous name in handsets, faces a daunting task to catch up with Apple in the high end of the smartphone market, where it has fallen behind both the iPhone and Google Inc's Android devices.

APPLE PAYS

Apple and Nokia have been locked in a legal tussle since October 2009, when Nokia sued Apple in the United States, arguing the iPhone maker was getting a free ride on technologies patented by Nokia.

An Apple spokesman confirmed the deal. Apple shares were up 1.38 percent at 1625 GMT.

Nokia said details of the deal -- which settles all litigation between the two and means both sides will withdraw complaints to the U.S. International Trade Commission -- were confidential.

It is clear that Apple will be the payer here, and the sums will be significant, said Swedbank analyst Jari Honko.

MORE BATTLES AHEAD

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.

To build up its mobile patent warchest Google has offered to pay $900 million for more than 6,000 patents and patent applications belonging to Nortel Networks, a once mighty Canadian network equipment maker.

Nokia, which has said it will be more aggressive in licensing its patents, flagged further legal battles were ahead.

This settlement .... enables us to focus on further licensing opportunities in the mobile communications market, CEO Elop said in a statement.

Analysts said makers of Google Android phones were the next likely target.

Emerging victorious from such a war, Nokia is in a strong position to collect royalties from other industry players, particularly from makers of Android-based devices, Mueller said.

Analysts warned Nokia still had a long way to go toward any recovery.

This (the Apple deal) could cause the stock to have a bit of a relief rally today, but does very little to address the stark reality that the company is facing, said Richard Windsor, analyst at Nomura.

(Additional reporting by Jussi Rosendahl in Helsinki, Poornima Gupta in San Francisco, Blaise Robinson in Paris and Dominic Lau in London; Editing by David Cowell)