Ailing Nokia on Thursday surrendered its lead in the global smartphone market to rival Apple and shed more market share as it reported a steep net loss for the second quarter.

Nokia's outloook for its handset business to be profitable in the current quarter brought some relief to its battered share price but analysts doubted it would dispel fears about the future of the onetime cellphone leviathan.

Nokia, still the world's largest phone maker by volume, has failed to come up with an attractive smartphone offering to compete with Apple's iPhone, Research In Motion's BlackBerry and a wide array of handsets using Google's Android software.

Nokia said it sold 16.7 million smartphones in the quarter, falling behind Apple's 20.3 million iPhones.

Its quarterly phone sales volume were down 20 percent from a year ago, missing analysts' forecasts, at a time when the overall global market grew around 10 percent.

A Reuters calculation showed that Nokia's overall market share fell to 23.7 percent from 29.1 percent in the previous quarter. Before rivals stole its lunch, Nokia enjoyed a near 40 percent market share.

The Finnish company created the smartphone market in 1996 with its first Communicator model but in recent years has failed to match the appeal of Apple and RIM's models.

It is now pinning its turnaround hopes on a new suite of devices using Microsoft software, but these will only come to market later this year.

The path to recovery for Nokia is going to be a long one. Deterioration in Nokia's smartphone performance shows that time is of the essence in rebuilding a coherent portfolio of Windows Phone 7 products in 2012, said CCS analyst Geoff Blaber.

ROYALTY BOOST DRAGS Q2 TO THE BLACK

Nokia's shares initially jumped almost 8 percent when its underlying quarterly results came in above analysts' expectations and the company forecast its struggling cellphone business would be profitable in the third quarter.

It is a glimmer of hope in an overall very gloomy picture, said Angus Campbell, head of sales at Capital Spreads.

But as investors turned their focus to a quarterly net loss of 492 million euros, the shares gave up most of their gains and were up just 2.2 percent at 4.17 euros by 1500 GMT.

Nokia reported a second-quarter underlying operating profit of 391 million euros ($555.1 million), above all analysts' forecasts, boosted by one-off royalty revenues of 430 million.

Nokia had forecast a 150 million royalty boost in April, and analysts said most of the remaining 280 million likely came from settling a legal dispute with Apple.

But the net loss of 0.10 euros per share in the quarter was below all analysts' forecasts.

To summarize, Q2 was a difficult quarter, Chief Executive Stephen Elop said at a conference call, while promising improvements ahead. We're starting to see a very positive impact on the health of Nokia.

Nokia said it wants to cut more than an originally-planned 1 billion euros in annual costs by trimming spending on subcontracting, IT systems and staff travel.

The share price has halved since February when it unveiled a shift to Microsoft software, as investors worried that the company would lose so much market share before the new phones come out that it might never make up lost ground.

Their guidance for the third quarter is more or less in line with expectations, or maybe a bit better, said Greger Johansson, analyst at Redeye. However, the uncertainty around Windows mobile phones remains great.

(Additional reporting by Joanne Frearson and Georgina Prodhan in LONDON, Terhi Kinnunen and Ritsuko Ando in HELSINKI; Editing by David Cowell)