Safeway (SWY) announced Wednesday evening that it will sell Canada Safeway Limited and its assets for $5.7 billion to Sobeys, a privately held Canadian food retailer. After taxes and expenses, Safeway will clear around $4.0 billion.

Under the terms of the deal, Sobeys will acquire 213 grocery stores in western Canada, 10 liquor stores, 12 manufacturing centers, and four distribution centers. 199 of the grocery stores include in-store pharmacies and 62 have gas stations.

Safeway Canada was a highly profitable operation for Safeway, earning $268 million in net income over the last four quarters. However, Safeway believes the sale represents outstanding value for shareholders. The company plans to use the proceeds to pay off $2 billion in debt, buy back stock, and invest in some growth opportunities.

Meanwhile, Sobeys is equally satisfied with the transaction. CEO Paul Sobey said in a company statement, “The acquisition of Canada Safeway represents an excellent strategic fit, strengthening our presence in Western Canada with the addition of great employees, excellent stores and exceptional real estate…this is a win-win for both companies.”

Safeway’s market cap closed at $5.57 billion on Wednesday, yet it will receive $5.7 billion just for its Canadian stores. Even after taxes and fees, the sale constitutes tremendous value.

As a result, shares exploded as much as 42 percent in after hours trading, hitting a five-year high of $32.97.