Walmart has agreed to a deal to buy a majority stake in Indian e-commerce giant Flipkart for $16 billion.

The U.S. retail giant said Wednesday that it would acquire an initial stake of roughly 77 percent in Flipkart. The remainder of the business will be held by existing investors, including Flipkart's co-founder Binny Bansal, Tencent, Tiger Global and Microsoft.

Walmart said in a statement that its long-term aim would be to support Flipkart's transition into a publicly listed subsidiary. The retailer said it expects India's e-commerce market to grow at four times the rate of the overall retail industry.

Walmart's president and chief executive, Doug McMillon, said the investment in Flipkart was part of the company's aim to invest in India's fast-growing economy.

"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 e-commerce in the market," McMillon said in a statement.