Research In Motionreported a smaller quarterly loss than Wall Street had expected on higher revenue.
After the earnings announcement, the BlackBerry maker's shares shot up more than 14 percent in extended-hours trading. (Click here to get the latest quotes for Research In Motion shares.)
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.
Revenuedecreased 31 percent to $2.87 billion from $ 4.17 billion.
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.
Following the report, CEO Thorsten Heins said RIM continues to see a very aggressive pricing environment as carriers carry less inventory and replenish it less often.
Heins said the company laid off about 2,000 workers in the second quarter. Most of the remaining layoffs will occur in the current quarter. The company expects continuing pressure on revenue and gross margin and another loss in the third quarter.
The company said it shipped 7.4 million BlackBerry smartphones during the quarter and 130,000 PlayBook tablets. RIM's biggest markets include Indonesia, South Africa and Venezuela.
"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.
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 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 iPhone and smartphones that operate on Google's Android operating system.