Asda is valued at £7.3 billion (R124 billion) on a debt-free basis in the transaction. Sainsbury's will buy the bulk of shares from Walmart for £2.9 billion (R49 billion) and Walmart will receive a 42% share of the combined businesses. Walmart will remain a "strategic partner and long-term shareholder."
Walmart has owned Asda since 1999 when the US retail giant bought it for £6.9 billion (R117 billion). Recently Asda has struggled, posting its worst annual results since the takeover last year. Walmart said it expects to take a non-cash loss of $2 billion on the deal, although it cautioned that this figure could "fluctuate significantly due to changes in the fair value of the equity consideration to be received and changes in currency exchange rates."
Sainsbury's shares jumped 15% on Monday morning following news of the deal.
The deal will have to clear the UK's Competition and Market's Authority (CMA) but if approved would create one of the biggest companies in Britain, with a market value of around £13 billion and annual sales of £50 billion.
Bruno Monteyne, an analyst with Bernstein, said in a note to clients: "Local competition, within 10 to 15 minutes' drive time, remains the key driver of store disposals. We think the potential gamble will depend on how the CMA treats discounter stores. In the past, they were largely excluded (as being too small and therefore not a comparable one-stop shop).
"57% of Asda stores have a large Sainsbury's store within 12.5 minutes drive time, leading to ~15% of store disposals. If they can convince CMA to include discounters, then it could be ~8%."
He added: "This deal could easily unravel acrimoniously if the CMA sticks to its old rules and parameters. At 13% store disposals, the deal would stop being accretive."
Both the Asda and Sainsbury's brands will be retained. Asda is one of the lowest priced major UK supermarkets and generally targets working-class customers in the North. Sainsbury's targets middle-class customers in the South East.
Sainsbury's touted cost savings of £500 million in synergies but said it will not close stores as a result of the deal. It said the greater scale of the business post-merger would allow it to invest in lowering prices. The supermarket said it expects to lower prices by up to 10%.
Sainsbury's chairman, CEO, and CFO will lead the combined business. Sainsbury's chairman David Taylor said in a statement: "As one of the largest employers in the country, the combined business will become an even greater contributor to the British economy.
"The proposal will bring together two of the most experienced and talented management teams in retail at a time when the industry is undergoing rapid change. We welcome Walmart as a significant shareholder and look forward to working closely with them."
Walmart International CEO Judith McKenna called the deal a "unique and bold opportunity, consistent with our strategy of looking for new ways to drive international growth."
UBS and Morgan Stanley advised Sainsbury's on the deal. Rothschild advised Walmart.
The mega-merger comes amid a frenzy of deal activity in the UK supermarket sector. Last year Tesco, the UK's biggest supermarket chain, won CMA approval for its £3.7 billion merger with wholesaler Booker and Sainsbury's bought catalogue retailer Argos for £1.2 billion in 2016.