Troubled smartphone maker BlackBerry announced that it has signed an agreement under which a consortium — to be led by Fairfax Financial Holdings — would buy the company for $4.7 billion and take it private.

Last Friday, BlackBerry announced plans to lay off 4,500 employees, about 40% of its global staff, and said it had a nearly $1 billion net operating loss last quarter.

With the restructuring, the Canadian device maker said it would focus on its core business customers and forgo marketing to consumers. BlackBerry built a strong following among business users with its trademark device, but has lost share to others in the category including Apple — which said it sold 9 million new iPhones over the past weekend — and Samsung Electronics.

The takeover is contingent on the Fairfax-led consortium securing financing for the deal. According to the companies, the investment consortium is seeking financing from Bank of America Merrill Lynch and BMO Capital Markets.

Under the proposed agreement, BlackBerry shareholders would receive $9 in cash for each share they hold. The financial consortium would acquire for cash all of the outstanding shares of BlackBerry not held by Fairfax, which owns approximately 10% of BlackBerry’s common shares and intends to contribute those into the transaction.

Shares of BlackBerry were halted prior the announcement at 1:30 p.m. Eastern, at $8.230 per share, and immediately rose to $9 per share when trading resumed. BlackBerry’s stock fell 17% on Friday after the company announced the layoffs and an expected net loss of about $950 million to $995 million for its fiscal second quarter of 2014, which ended Aug. 31.

BlackBerry said due diligence is expected to be completed on the transaction by Nov. 4. The provisions of the agreement give BlackBerry the “opportunity to determine if there are alternatives superior to the present proposal from the Fairfax consortium,” Barbara Stymiest, chair of BlackBerry’s board of directors, said in a statement.

Prem Watsa, chairman and CEO of Fairfax, said in a statement that the proposed deal would deliver “immediate value to shareholders, while we continue the execution of a long-term strategy in a private company with a focus on delivering superior and secure enterprise solutions to BlackBerry customers around the world.”

For BlackBerry’s special committee of the board, J.P. Morgan and Perella Weinberg are acting as financial advisors and Skadden, Arps, Slate, Meagher & Flom LLP and Torys LLP are acting as legal advisors. For Fairfax, BDT & Company, LLC, BofA Merrill Lynch and BMO Capital Markets are acting as financial advisors, and Shearman & Sterling LLP and McCarthy Tétrault LLP are acting as legal advisors.