Research In Motion posted surprisingly strong quarterly earnings on Thursday and offered a rosy outlook that signaled further growth despite the global economic slowdown as consumers embrace its newest BlackBerry smartphones.

The results, which also revealed RIM now has a total of 25 million BlackBerry subscribers, sent the company's shares soaring about 17 percent in after-hours trade.

RIM's profit rose to $518.3 million, or 90 cents a share, in its fourth quarter, ended February 28, from $412.5 million, or 72 cents, a year earlier.

The results topped the expectations of analysts, which had been dampened by a profit warning that RIM delivered in February.

That warning seemed ancient history on Thursday as RIM's shares jumped to $57.40 in late trading from their regular-session close of $49.09 on the Nasdaq.

They are crushing it, Canaccord Adams analyst Peter Misek said. Not only are they holding up, but it's clear they're gaining market share.

Revenue was $3.46 billion, up 84 percent from $1.88 billion in the year-before quarter.

For the current quarter ending May 30, RIM expects revenue of between $3.3 billion and $3.5 billion and earnings per share of 88 cents to 97 cents. Gross margin is expected to come in between 43 and 44 percent, the company said, up from 40 percent currently.

It expects to add between 3.7 million and 3.9 million subscribers. It added 3.9 million this quarter.

This is wildly better than people were looking for, said Duncan Stewart, analyst at DSAM Consulting in Toronto. Getting improvement in both margin and growth at the same is a rare thing in the field of technology.

Analysts had expressed concern about RIM's ability to maintain momentum during the recession.

Retail consumers have curbed spending, which may mean they are not willing to pay more for flashy new smartphones. But that may be coming to an end, Misek said.

There was a big rebound in consumer demand in mid-February, he said, adding BlackBerry handsets are selling well with wireless carriers such as Verizon and Vodafone

.

Large corporations that use the BlackBerry as the mobile communications tool of choice have also been cutting their budgets. This could prompt them to delay upgrading to newer BlackBerry models.

RIM's main customers have traditionally been business executives, lawyers, politicians and other professionals who use its BlackBerry handsets to send wireless email securely.

To diversify its user base, RIM has pushed aggressively into the broader consumer market with multimedia-laden handsets like the Pearl model and the touchscreen BlackBerry Storm -- its answer to Apple's popular iPhone.

This week, it also launched an online store to sell entertainment, games, news and travel software to BlackBerry users.

While the iPhone has been a hit with consumers, it has yet to gain enough traction with business users to threaten RIM's dominant position in the corporate client market.

($1=$1.24 Canadian)

(Reporting by Wojtek Dabrowski; Editing by Peter Galloway)