BlackBerry says it will lay off 4,500 employees, or 40 percent of its global workforce, as it reports a nearly $1 billion second-quarter loss in a surprise early release of earnings results.

The stock dropped 19 percent to $8.50 after reopening for trading. Shares had been halted pending the news.

BlackBerry had been scheduled to release earnings next week. But the Canadian company said late Friday afternoon it expects a loss of about $950 million to $995 million for the quarter, including a massive inventory charge due to increasing market competition.

The BlackBerry, pioneered in 1999, was the dominant smartphone for on-the-go business people and other customers before Apple debuted the iPhone in 2007. Since then, BlackBerry Ltd. has been hammered by competition from the iPhone as well as Android-based rivals like Samsung.

Blackberry sales in the fiscal second quarter were about $1.6 billion – just more than half the $3.03 billion average estimate of analysts surveyed by Bloomberg.

The company sold about 5.9 million smartphones in the quarter, it said. BlackBerry had 12,700 employees as of the end of March, the last time it has reported a figure. The inventory writedown is mostly based on the value of Z10 touch-screen devices, the company said.

The adjusted second-quarter net loss will be as much as $265 million, or 51 cents a share, compared with the average analyst estimate of 16 cents.

Chief Executive Officer Thorsten Heins was counting on the new BlackBerry 10 phones – introduced in January to good reviews – to reverse a sales slide, return the company to profitability and make the brand hip again. Instead, its market share continues to slide and BlackBerry remains unprofitable. Corporate customers such as Morgan Stanley are holding off on upgrading to the new platform, concerned that the company won’t be around to support the devices, people familiar with the matter said last month.

Writedown Streak

The writedown extends a streak of inventory charges, which were previously spurred in part by the ill-fated PlayBook tablet. The company took a pretax expense of $485 million in December 2011, a second charge of $267 million the following March and a third writedown of $335 million in June 2012.

Still, BlackBerry continues to introduce new products. In addition to the Q10, Z10 and Q5 released so far this year, BlackBerry this week introduced the Z30, a model with the company’s largest screen yet. It goes on sale in the U.K. and Middle East starting next week.

BlackBerry has hired accounting firm PricewaterhouseCoopers LLP to evaluate the company for potential buyers, according to two people with knowledge of the move.

A team of accountants and lawyers from the New York-based firm have been working at BlackBerry since August, said the people, who asked not to be identified because the contract hasn’t been made public.

It previously hired Perella Weinberg Partners LP as an adviser – alongside its bankers at JPMorgan Chase & Co. – to help explore its options, a person familiar with the decision said earlier this month.

(The Associated Press and Bloomberg News contributed to this report).