Sainsbury's is planning to merge with Asda in the UK to create a £13 billion supermarket giant.
Walmart has owned Asda since 1999 but the low-priced retailer has been struggling recently.
Walmart will own 42% of the combined group, take a $2 billion non-cash loss on the deal.
The competition regulator could still scupper the deal.
LONDON — Sainsbury's, the UK's second-biggest supermarket, has reached a deal with Walmart to merge with Asda, the discount UK supermarket owned by the US retail giant.
Asda is valued at £7.3 billion ($10 billion) on a debt-free basis in the transaction. Sainsbury's will buy the bulk of shares from Walmart for £2.9 billion ($3.9 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 ($9.5 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.
'This deal could easily unravel acrimoniously'
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 ($17.8 billion) and annual sales of £50 billion ($68.7 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.
'A unique and bold opportunity'
Sainsbury's touted cost savings of £500 million ($687.7 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 ($5 billion) merger with wholesaler Booker and Sainsbury's bought catalogue retailer Argos for £1.2 billion ($1.6 billion) in 2016.