BlackBerry surprised Wall Street by posting financial results that beat analysts' expectations.
Shares rose 13 percent in premarket trading as CEO John Chen cut expenses quicker than expected.
The embattled smartphone company reported net income of $23 million, or 4 cents per share, for the three months ended May 31. It had reported a loss of $84 million, or 16 cents per share, a year ago.
Excluding unusual items, its adjusted loss was 11 cents per share in the latest period. Analysts surveyed by FactSet expected a loss of 35 cents per share.
Revenue fell to $966 million from $3.07 billion a year ago. Analysts expected revenue of $961.7 million.
Shares rose 1.08, or 13 percent, to $9.38 in premarket trading shortly before U.S. markets open.
"We are getting very close to making money or at least break even on hardware. Not quite there yet, but close," Chen said on a conference call with analysts.
It is the third quarterly results under Chen, who is deemphasizing the hardware business after last year's launch of the BlackBerry 10 failed to spark a turnaround. The BlackBerry has been hammered by competition from the iPhone as well an Android-based rival.
"He's doing exactly what John Chen should be doing. He's right sizing the business to fit demand. He is focused in the areas where he is still relevant. He's cut partnerships to shore up weaknesses," said Colin Gillis, an analyst at BGC Partners. "If they can get this business where they are selling a million phones a month they'll be a nice little niche. It will be a nice little profitable business."
BlackBerry sold 2.6 million phones in the quarter and reported cash and investments of $3.1 billion. Chen said 80 percent of BlackBerry's 50 million subscribers are business users.
"People stay with BlackBerry because they're enterprise users, there's high productivity and security. I would say 80 percent of that 50 million is this perfect base for us," Chen said.
Chen said the company will launch a new keyboard smartphone model called the BlackBerry Passport in London in September followed by the previously announced Classic in November.
Chen, who is credited with turning around Sybase, a data company that was sold to SAP in 2010, has been putting more emphasis on BlackBerry's mobile device management business, a collection of software that allows IT departments to manage different devices connected to their corporate networks. He has also emphasized BlackBerry's popular BlackBerry Messenger application that is now also available on Apple and Android devices. And he's tried to highlight Blackberry's embedded QNX software systems, which are used in-vehicle infotainment systems and industrial machines.
BlackBerry announced Wednesday that it is adding the Amazon Appstore to its phones. That will give users of the newest BlackBerry operating system easy access to thousands more of the most popular Android apps and games. The struggling smartphone maker has been criticized for the lack of applications available for its devices.
BlackBerry announced last December that it entered into a five-year partnership with Foxconn, the Taiwanese company that assembles products in vast factories in China. Foxconn, known for its manufacturing contract work on Apple's iPhones and iPads, jointly designs and manufactures most BlackBerry devices and manages inventory of the devices in an agreement that offloads much of BlackBerry's manufacturing costs. Chen has said for months that he'll be happy to break even or make a small profit on the device business.