As expected, Nokia today reported a loss of $341 million for the second quarter, down from the year-ago quarter when the company posted a profit of $417 million. Net sales were down 7 percent year over year to $13.13 billion.

Total smartphone device sales were also down. Nokia sold 16.7 million smartphones, down 34 percent from the 24 million units it moved in the second quarter 2010. Sequentially smartphone sales were down 31 percent from 25.2 million units in the first quarter of 2011.

Even with these losses, Nokia managed to beat expectations, as payments to Apple for a settled patent dispute came below analyst estimates at $553 million. Sales were also above earlier forecasts by about $2 million. Total device sales, including feature phones, came in well below expectations. Nokia sold a total 88.5 million devices. Analysts had figured on 95.5 million.

All that said, investors generally liked what they saw today, banking on the company's ability to get back on its feet with the impending launch of new Windows Phone 7 smartphones by the end of the year. Shares of Nokia were up almost 5 percent immediately following an earnings call early this morning.

Nokia CEO Stephen Elop said that the challenges the company has faced during its strategic transformation manifested in a "greater than expected way" during the second quarter. "However, even within the quarter, I believe our actions to mitigate the impact of these challenges have started to have a positive impact on the underlying health of our business," Elop said in a statement.

The company says it is accelerating plans for expense reductions and hopes to exceed a previous target of non-IFRS operating expense reductions in Devices & Services of $1.4 billion for the full year 2013.

Due to what the company called "limited visibility," Nokia is providing a wider than normal range for its Devices & Services non-IFRS operating margin outlook for the third quarter. Nokia expects its non-IFRS Devices & Services operating margin in the third quarter to be slightly above breakeven, ranging either above or below this level by approximately 2 percentage points.