BlackBerry has agreed to sell itself for $4.7 billion (£2.85bn) to a group led by its largest shareholder, Fairfax.
BlackBerry said a letter of intent has been signed and its shareholders will receive $9 in cash for each share.
Fairfax head Prem Watsa is a former board member who owns 10% of BlackBerry.
He stepped down when BlackBerry announced it was considering a sale last month.
The billionaire is one of Canada’s best-known value investors.
Trading of the company’s stock was halted ahead of the news.
BlackBerry shares plunged on Friday after the firm announced a loss of nearly a billion dollars and layoffs of 4,500 workers.
The BlackBerry, pioneered in 1999, was once the dominant smartphone for on-the-go business people and other consumers before Apple’s iPhone debuted in 2007.
Mr Watsa has been compared to Warren Buffett because of his investing approach.
BlackBerry founder Mike Lazaridis recruited him to join the company’s board when Mr Lazaridis and Jim Balsillie stepped aside as co-chief executives in January last year.
BlackBerry said its board of directors approved the terms of the letter of intent.
The statement said BlackBerry and Fairfax will negotiate and execute a definitive transaction agreement by November 4.
Mr Watsa said in April that he was a “big supporter” of current chief executive Thorsten Heins and called his promotion the right decision in 2012.
He also said he was excited about the company’s new BlackBerry 10 operating system.
This year’s launch of BlackBerry 10, its revamped operating system, and fancier devices the touchscreen Z10 and Q10 for keyboard loyalists was supposed to rejuvenate the brand and lure customers.
But the much-delayed phones have failed to turn the company around.