Updated on May 9: Walmart Inc., the world’s largest retailer announced on Wednesday that it will buy 77% initial stake in Flipkart for $16 billion, in what is the world’s largest mergers and acquisitions, which values the Indian ecommerce major at $20.77 billion.

“India is one of the most attractive retail markets in the world, given its size and growth rate, and our investment is an opportunity to partner with the company that is leading transformation of eCommerce in the market,” said Doug McMillon, Walmart’s president and chief executive officer in a statement.

McMillon added that it Flipkart’s earlier investors — Tencent, Tiger Global and Microsoft will continue to be part of the company. “We are confident this group will provide Flipkart with enhanced strategic and competitive advantage. Our investment will benefit India providing quality, affordable goods for customers, while creating new skilled jobs and fresh opportunities for small suppliers, farmers and women entrepreneurs,” he said.

The remaining 23% of Flipkart will be Flipkart’s co-founder Binny Bansal, Tencent Holdings Limited, Tiger Global Management LLC and Microsoft Corp. SoftBank, which was the largest shareholder in the company will exit, and is expected to have made $4.77 billion for an invest of $2.5 billion eight months ago.

In the future Walmart wants to transition into a publicly-listed, majority-owned subsidiary in the future. “This investment is of immense importance for India and will help fuel our ambition to deepen our connection with buyers and sellers and to create the next wave of retail in India,” said Binny Bansal, Flipkart’s co-founder and group chief executive officer.

Walmart’s investment includes $2 billion of new equity funding, which will help Flipkart accelerate growth in the future. Walmart and Flipkart are in talks with additional potential investors who may join the round. The final make-up of the board has not been determined yet.

We have updated the story after Walmart’s announcement. Our earlier story said:

Walmart Inc. has decided to go all in on its deal to acquire Flipkart in a deal sealed on Thursday to buy 73% of the Indian ecommerce company in one of the biggest mergers and acquisitions in the country – spending at least $14.6 billion in the cash-and-stock buyout.

One source said Flipkart was valued at $20 billion, while two others said Walmart, the world’s largest retailer, had put the target company’s value at as much as $22 billion, a price at which it will spend more than $16 billion.

Alphabet Inc., the parent company of search giant Google, is said to be participating in the deal with a $3 billion investment.

Kalyan Krishnamurthy will stay on as chief executive of Flipkart.

Both the companies signed tentative agreements after meetings, which went on for most of Thursday. “Everything has been finalised… The papers have been signed by both the parties,” said one of the sources, adding this was the biggest acquisition deal by Walmart.

The sources also confirmed that the deal will be a mix of cash and stock. “Cash component will be close to 55%, which will mark the exit of some of the largest investors in Flipkart,” a second source said. All three sources asked to stay anonymous in this story because of the acquisition has not been officially announced.

“Some of the friendly investors like Tencent, Microsoft and Tiger Global will not cash out completely,” said the first source. Softbank, which holds a little over 20% stake in Flipkart will exit the company fully and is expected to make $4 billion – a 60% return on its investment of $2.5 billion merely eight months ago.

Involved in the deal were JP Morgan Chase as Walmart’s banker (Flipkart has a firm representing them from Singapore), Amarchand Mangaldas as legal advisors, and Bain & Co. as management consultants.

Flipkart, Walmart, and Google had not responded to requests for comment at the time of publishing this story.

IPO on the cards

Walmart has told Flipkart’s board that it intends to sell shares of the Indian ecommerce firm in an initial public offer (IPO) in three years time. “That has already been discussed as part of the deal talks,” said the first source.

The second source said that once Flipkart gets closer to profitability, an IPO would be very much on cards. “An IPO is important for a company to become transparent and accountable,” the second source added.

While CEO Krishnamurthy will continue to helm Flipkart, one among its two founders – Sachin Bansal, chairman, or Binny Bansal, group chief executive – may exit. Earlier, FactorDaily had reported that Binny Bansal will quit the company. “But, nothing is final,” one of the sources said.

Most of the remaining senior leadership will stay unchanged, confirmed two of the sources. “Walmart doesn’t want to run Flipkart… It will only look at build better governance and transparency,” said the first source.

The second source added that Flipkart is not the first Indian ecommerce company Walmart checked out. Others like Snapdeal and ShopClues were also probable targets, but Walmart wanted to go with the largest company, despite the size of the deal.

The reason: Flipkart has a large logistics network, is the largest ecommerce company and has stood up to US giant Amazon’s onslaught, and will play an important role in building a robust grocery marketplace.

Building the agri-supply chain

The single biggest reason for Walmart’s interest in Flipkart is its grocery business – something that Walmart has been trying to build for a decade. Indian laws don’t allow Walmart to open physical stores as the government has still not allowed foreign direct investments in multi-brand retail.

“Building the agri supply chain was the single largest driver in the deal… Walmart’s focus on foods isn’t changing be it physical retail or ecommerce,” said the first source. “One has to look at traceability and tracking in the food supply chain… Walmart is going big on farm to home.”

So much so that it plans to bring its China model of blockchain based-supply chain to India when it comes to food retail. “Walmart wants to use blockchain technology for traceability… It is important for food safety,” said the first source.

In China, Walmart has partnered JD.com (a company in which it has invested), IBM and Tsinghua University National Engineering Laboratory for E-Commerce Technologies in the Blockchain Food Safety Alliance. JD.com is China’s second largest ecommerce company after Alibaba.

Most of the investments here will go into food, the sources said. Almost 50% of the primary investment will go into building the food and grocery supply chain, they added.

“Walmart plans to build that in India, too… food and grocery will have huge upsides in India,” said the first source. “Whoever brings that will bring a lot of loyalty and consumerization.”