Euan Rocha, Alastair Sharp and Allison Martell, REUTERS

TORONTO - BlackBerry Ltd said on Friday it was entering a handset production deal that lowers the risk it will have to take more massive writedowns on unsold smartphones, and its shares surged even though it posted dismal quarterly results.

The stock rose as much as 17% after the company announced the five-year partnership with Taiwan's Foxconn Technology Co Ltd, which will initially build low-end devices for sale in Indonesia and other emerging markets. BlackBerry said it hoped to expand the fledgling relationship to its top-of-the-line smartphones.

The deal is unconventional in that BlackBerry will no longer pay upfront for components used in the devices made on its behalf in Foxconn's Indonesian and Mexican factories.

Instead, Foxconn will take a share of profit on each device in return for taking on inventory management, which can result in writedowns if smartphones go unsold. Foxconn will also help with developing, designing and distributing the handsets.

Chief Executive John Chen, who took the helm at BlackBerry last month, said he expected the Foxconn deal to help BlackBerry's handset business turn cash-flow positive, and for the company as a whole to post a profit for the fiscal year that begins in early 2015.

"It's almost like BlackBerry is disposing of its consumer handset business without actually disposing of it," said Jefferies analyst Peter Misek, who likened the deal to what Hewlett-Packard Co and Dell have done with laptops.

The move, which comes a month after BlackBerry said it was giving up on a plan to sell itself, helped take the sting out of the massive, $4.4 billion loss that it posted for the quarter ended Nov. 30, as smartphone sales shriveled.

A new line of devices running on BlackBerry 10 software has failed to gain traction, forcing the company to write off $1.6 billion of inventory and supply commitments for the quarter. The previous quarter it wrote off $934 million for unsold phones.

The Waterloo, Ontario-based company pioneered the concept of on-the-go email, and for years its pagers and phones were must-have devices for political and business leaders. But in recent years it has lost its once-dominant market share to Apple Inc's iPhone and a slew of smartphones powered by Google Inc's Android operating system.

As of Thursday's close, the stock had fallen 47% this year. It was last trading up 14% on Nasdaq at $7.13.

"The most immediate challenge for the company is how to transition the devices operations to a more profitable business model," said Chen, who is credited with turning around Sybase, a database and mobile software company, before it was sold to German software company SAP AG in 2010.

Chen has said he is counting on strong growth in BlackBerry's service business, which manages smartphone traffic on the internal networks of corporate and government clients.

"Just jettisoning all the stuff and driving on with the part of the business that makes money makes a heck of a lot of sense to me and that is very clearly where Chen is going," said Ross Healy, a portfolio manager at Macnicol & Associates who owns a small number of BlackBerry shares.

Carolina Milanesi, an analyst at Kantar Comtech, said the deal is a good move for Foxconn, the world's largest electronic parts manufacturer and a major partner of Apple Inc.

"This might be the first step for them to try and diversify, and experiment with putting their brand on the products they make," she said.

DEVICES ARE A CHALLENGE

In his first presentation to analysts after the release of BlackBerry's results, Chen struck an upbeat tone tempered with a heavy dose of realism. The mix may have helped soothe nervous investors who had sharply lowered their expectations for BlackBerry after a string of disappointing news.

"It's clear that he's not the old guard, he's not there trying to do what Lazaridis and Thorsten were up to. He's actually been taking some concrete steps," said Mark McKechnie, an analyst at Evercore Partners, referring to BlackBerry's founder Mike Lazaridis and Thorsten Heins, Chen's predecessor.

Chen moved quickly to stamp his authority on BlackBerry, hiring several former colleagues from his time at Sybase and SAP for senior roles in corporate strategy, marketing, and enterprise strategy, a key unit in the stripped-back company.

BlackBerry sold about 4.3 million handsets in the third quarter, with older BlackBerry 7 models accounting for about 3.2 million of that number.

The company recognized hardware revenue on 1.9 million devices, down from 3.7 million in the previous quarter.

On a brighter note, its cash pile grew to $3.2 billion US from $2.6 billion a quarter earlier, but that included $1 billion raised by issuing convertible notes to a group of investors last month after calling off a months-long search for a buyer.

Service revenue slipped 13% as fewer people paid to use BlackBerry's secure network, and the company said that level of decline could be expected to continue.

Along with the writedown on unsold phones, the company also slashed by $2.7 billion the carrying value of some long-lived assets, mostly licensing deals made when it was far larger.

QUARTERLY RESULTS

The company reported a third-quarter net loss of $4.4 billion, or $8.37 a share, compared with year-earlier net income of $9 million, or 2 cents a share.

Excluding the inventory writedowns and impairment charges, the loss was $354 million, or 67 cents a share.

Analysts on average had expected a loss of 44 cents a share, according to Thomson Reuters.

Revenue fell to $1.19 billion from $2.73 billion as increased uncertainty about the company's fate led to further sales erosion. Wall Street had forecast $1.6 billion.

Morningstar analyst Brian Colello said BlackBerry's turnaround strategy was more important than its latest operating results.

"I don't think it's a surprise that the revenue, operating margin and the business continues to decline. I think the bigger question is, what is the turnaround story at this point?" he said. "They have a lot of different assets that could point the company in different directions.")