BlackBerry said today that it broke even in its first fiscal quarter, beating expectations.

The smartphone industry pioneer also forecast a smaller than expected annual loss, despite its revenues falling sharply.

The Canadian company, which has shifted focus from its once-dominant smartphones to the software that companies and governments need to manage their devices, said it expects to post an adjusted annual loss of around 15 cents per share. 

Analysts had estimated a fiscal 2017 loss of 33 cents per share.

Excluding one-time items, the company posted profit of $14m, while its adjusted revenue came to $424m.

Analysts, on average, expected a loss of 8 cents a share on revenue of $470.9 million, according to Thomson Reuters. 

The Ontario-based company reported a net loss of $670m, or $1.28 cents a share, as it ran up costs to restructure operations and wrote down the value of some assets. 

A year ago, it reported a profit of $68m, or 10 cents a share. 

BlackBerry said the net loss reflected a $501m impairment charge, a $57m goodwill impairment charge, and a $41m writedown of inventory and other charges.

It said that software and licensing revenue came to $166m in the three months to the end of May, just below the growth rate the company has targeted for the full year.