TORONTO — BlackBerry's largest shareholder has reached a tentative agreement to pay $4.7 billion for the troubled smartphone maker, even as many investors fret about its potential demise.

BlackBerry Ltd. said Monday that Fairfax Financial Holdings Ltd. has signed a letter of intent to buy the company for $9 per share in cash and take it private. The tentative deal comes just days after the Canadian company announced plans to lay off 40 percent of its global workforce. The offer price is below what the company had been trading at before the layoff announcement.

Analysts say that although BlackBerry's hardware business is not worth anything, the company still owns valuable patents. BlackBerry is also strong in having total cash and investments of about $2.6 billion, with no debt.