Walmart has snapped up India’s largest ecommerce retailer Flipkart for around $16bn (£11.8bn) after seeing off competition from Amazon.

The grocery giant has acquired a 77% stake in the Indian etailer, giving it a valuation of more than $20bn (£14.7bn).

The deal has been made despite Flipkart’s biggest rival Amazon mulling a bid for the firm, which has over 100 million users.

The ecommerce business, which was founded in 2007, has been under pressure from Amazon since it launched in India five years ago.

The grocery etailer has other high-profile investors including Microsoft, Tencent and Softbank, which will retain their stakes in the business following the deal with Walmart.

Walmart chief executive Doug McMillon said: “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.

“As a company, we are transforming globally to meet and exceed the needs of customers and we look forward to working with Flipkart to grow in this critical market.”

Flipkart co-founder and chief executive officer Binny Bansal said: “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.

“While ecommerce is still a relatively small part of retail in India, we see great potential to grow. Walmart is the ideal partner for the next phase of our journey, and we look forward to working together in the years ahead to bring our strengths and learnings in retail and ecommerce to the fore.”