Nokia reported a surprise fourth-quarter earnings recovery in a preliminary reports as sales of its Lumia smartphones drove handset sales, raising hopes that the struggling handset maker is starting to catch up to rivals. The stock surged over 20 percent on Thursday.

The company, which has been losing market share to Apple and Samsung, reported its first profit in a year for its mobile-phone business, excluding some items. That compares with its October forecast for a loss of as much as 10 percent.

The mobile phone business was mostly driven by sales of its Windows-based Lumia phones.  Nokia sold 4.4 million Lumia smartphones in the fourth quarter, rising from the third quarter’s 2.9 million.  The Lumia 920 smartphone, one of the first smartphones to run Windows Phone 8, has been gaining ground in the U.S.  However, the phone faced supply constraints with AT&T in the U.S. and operators in Italy and Germany, Nokia CEO Stephen Elop said on a conference call, adding that the bottleneck will persist during the first quarter.

Nokia also said it sold 9.3 million of its lower-priced Asha smartphones, driving total fourth-quarter handset sales to 86.3 million units. The Asha 311 smartphone starting selling in the third-quarter globally for €92 or $123.