Shares of Safeway (SWY) rallied 10% Thursday morning after the supermarket chain revealed a lucrative deal worth a hefty $5.7 billion to unload its profitable Canadian operations to Sobeys.

The price tag on the massive asset sale essentially matches Safeway’s entire market capitalization of about $5.6 billion as of Wednesday’s close.

In the wake of the surprise transaction, analysts on Wall Street were mixed on whether the decision to exit Canada will ultimately be a positive for the grocery-store chain, especially after having already spun off its gift-card unit Blackhawk.

J.P. Morgan Chase (JPM) raised its price target on Safeway to $28 from $26, while Guggenheim upped its target to $30 from $23. Both brokerages kept a “neutral” rating on the stock.

Other analysts were more cautious, with Citigroup (C) downgrading Safeway to “neutral” from “buy.”

“We have felt for some time that any steps by Safeway to monetize Blackhawk and the Canadian businesses would serve to expose the U.S. operations in a much more negative light," Cantor Fitzgerald analysts wrote in a note, according to The Wall Street Journal. "We think that reality has taken shape now that Safeway has spun off its main growth vehicle (Blackhawk) and sold its largest and most stable earnings stream (Canada)."

Late Wednesday Safeway disclosed the blockbuster deal, saying Empire Company Limited’s Canadian food retailer Sobeys agreed to acquire its Canadian operations for about C$5.8 billion in cash, or C$5 billion after taxes and expenses.

Safeway said it plans to use the proceeds to pay down $2 billion of debt and then use the remaining funds to buy back stock and invest in growth opportunities.

The Canadian business posted revenue of C$6.7 billion in the 12 months ending March 23. The deal is seen closing in the fourth quarter of 2013.

“We are pleased to enter into this agreement with Sobeys in order to realize the higher multiples attributed to Canadian supermarket companies," Safeway CEO Robert Edwards said in a statement. "The substantial cash proceeds from this transaction will allow us to create value for Safeway stakeholders and contribute to the growth of the ongoing business."

Shares of Pleasonton, Calif.-based Safeway rallied 10.17% to $25.47 Thursday morning, while Toronto-listed shares of Empire soared as much as 14%.

Follow Matt Egan on Twitter @MattMEgan5