Research In Motion reported a smaller quarterly loss than Wall Street had expected on higher revenue.
After the earnings announcement, the BlackBerry maker's shares (RIMM) shot up more than 14 percent in extended-hours trading.
The company reported a second-quarter net loss of $235 million or 45 cents a share, in the quarter. That compared with a profit of $329 million, or 63 cents, in the same period a year earlier.
Excluding one-time restructuring-related items, the loss was 27 cents a share, compared with a profit of 80 cents a share a year ago.
Revenue decreased 31 percent to $2.87 billion from $ 4.17 billion a year ago.
[More From CNBC: The Top US States for Technology]
Analysts had expected the company to report a quarterly loss excluding items of 46 cents a share on $2.5 billion in revenue, according to a consensus estimate from Thomson Reuters.
"It's still bad, but it's a much smaller disaster than expected. These stocks all trade on expectations. Expectations were really low, and they were able to beat that," said Shaw Wu, an analyst at Sterne Agee.
During its fiscal first quarter, the company increased its cash to about $2.3 billion from $2.2 billion.
The company said it shipped 7.4 million BlackBerry smartphones during the quarter and 130,000 PlayBook tablets.
"They shipped more than a million better than expected. They also lost a lot less money than expected, and the cash balance, even though they lost money, they were able to grow it slightly," Wu said.
[More From CNBC: 20 Stocks With the Potential to Drop]
Having sufficient cash on hand is seen as crucial to a successful launch of RIM's line of revamped smartphones that will run on its new BlackBerry 10, or BB10 operating system, that is due out early next year.
RIM's earnings release comes two days after the company's executives announced that its BlackBerry subscriber base had risen to 80 million from the 78 million it reported earlier this year.
Once a pioneer in the smartphone arena, BlackBerry has rapidly lost market share in North America to Apple's (aapl) iPhone and smartphones that operate on Google's (GOOG) Android operating system.More From CNBC