BlackBerry (BBRY) said it will sell the majority of its real estate holdings in Canada to Spear Street Capital for about $278 million. 

The Waterloo, Ontario-based smartphone maker said it expects to sell properties valued at 80% of the deal later this month, and the rest by the third calendar quarter of this year. 

The deal includes 3 million square feet of space and vacant lands. BlackBerry said it will lease some of the space back in a bid to keep up its presence in Canada. 

The company has been struggling for years with waning sales of its namesake devices amid increased competition from firms like Apple (AAPL) and Samsung. As such, it has been working to monetize various assets, such as real estate. 

The shares fell about 0.7% in pre-market U.S. trading, cutting into a 9.5% advance this year.