BlackBerry (BBRY) swung to a loss in the fourth quarter, but cost-cutting measures helped the smartphone maker stay ahead of Wall Street expectations.

The company said Friday its quarterly loss was $423 million, or 80 cents a share, versus a year-ago profit of $98 million, or 19 cents a share. Excluding one-time items, BlackBerry reported a loss of 8 cents a share, while analysts expected a much steeper loss of 55 cents.

Revenue tumbled 64% to $976 million, missing estimates of $1.11 billion and falling short of the $1 billion mark for the first time since 2007.

Ontario-based BlackBerry, which ditched an effort to sell itself last year, has moved to slash costs and revamp operations under new CEO John Chen.

In December, the company said it would outsource its handset business to Foxconn, a Taiwanese firm that produces Apple’s (AAPL) iPhone and other popular devices.

“We have significantly streamlined operations, allowing us to reach our expense reduction target one quarter ahead of schedule,” Chen said in a statement. “BlackBerry is on sounder financial footing today with a path to returning to growth and profitability.”

BlackBerry has also grappled with tepid demand for its new BlackBerry 10 smartphones, which continued to be outsold by older models. Fourth-quarter sales totaled 3.4 million devices, including 2.3 million BlackBerry 7 phones.

In a conference call with analysts, Chen added that BlackBerry anticipates fluctuations in losses until it reaches its profitability targets in fiscal 2016.

He also said BlackBerry plans to launch a new production run for BlackBerry 7 devices.

BlackBerry shares climbed 3.1% to $9.33 in pre-market trading. The stock has rallied 21.6% so far this year.

Follow Matthew Rocco on Twitter @MatthewRocco