Thorsten Heins, CEO of BlackBerry, is seen in Toronto on a video link from New York as he introduces the BlackBerry Z10. Fairfax Financial Holdings has offered to buy BlackBerry in a deal that values the Canadian smartphone company at about $4.7 billion on Monday.

TORONTO — BlackBerry has agreed to sell itself for $4.7 billion to a group led by largest shareholder, Fairfax Financial Holdings Ltd.

BlackBerry said Monday that 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 percent of BlackBerry. Watsa stepped down when BlackBerry announced it was considering a sale last month.

Watsa is one of Canada’s best-known value investors and the billionaire founder of Fairfax Financial Holdings Ltd. He has been compared to Warren Buffett because of his investing approach. BlackBerry founder Mike Lazaridis recruited Watsa to join the company’s board when Lazaridis and Jim Balsillie stepped aside as its co-CEOs in January, 2012.

Trading of the company’s stock was halted ahead of the news. BlackBerry shares plunged after the company announced Friday a loss of nearly $1 billion 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.

“We believe this transaction will open an exciting new private chapter for BlackBerry its customers, carriers and employees,” Watsa said in a statement. “We can deliver immediate value to shareholders, while we continue the execution of a long-term strategy in a private company.

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 Nov. 4.

Watsa said in April that he’s a “big supporter” of current CEO Thorsten Heins and called his promotion the right decision in early 2012. He also said he’s 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. At their peak in the fall of 2009, BlackBerry’s smartphones enjoyed global market share of over 20 percent, says Mike Walkley, an analyst with Canaccord Genuity. Their piece of the pie has since evaporated to just 1.5 percent.

BlackBerry said Friday it will lay off 4,500 employees, or 40 percent of its global workforce, as it tries to slash costs by 50 percent and shift its focus back to competing mainly for the business customers. A week earlier than expected, BlackBerry surprised the market by reporting Friday that it lost nearly $1 billion in the second quarter. The company is booking over $900 million in charges to write down the value of its unsold smartphones. BlackBerry said cutting its global headcount to 7,000 total employees is necessary. The company let 5,000 people go last year.

The company also said Friday it plans to focus on offering only two high-end devices and two entry-level handsets going forward, with emphasis on the business market.

BlackBerry, formerly known as RIM, was once Canada’s most valuable company with a market value of $83 billion in June 2008, but the stock has plummeted from over $140 share to less than $9. Its decline is evoking memories of Nortel, another Canadian tech giant, which ended up declaring bankruptcy in 2009.