The deal would be an aggressive and, some analysts say, risky foray by Walmart into one of the world’s last great open markets for online retailing. Although India has a significant middle class, most of the nation’s enormous population is still far too poor to afford much more than basic necessities. Flipkart has posted billions of dollars in losses while trying to build its business.

Still, Walmart missed out on China’s e-commerce boom, and it does not want to make the same mistake with India — especially with its rival Amazon already a strong player there. Only about 2 percent of India’s retail sales are online now, but tens of millions of Indians are getting onto the internet every year via cheap smartphones and rock-bottom mobile data prices.

Amazon has committed at least $5.5 billion so far to building its India presence, fighting to gain market share among the country’s young, increasingly tech-savvy shoppers. After starting an Indian site, Amazon.in, from scratch in 2013, Amazon blew past local players like Snapdeal and is now a close No. 2 to Flipkart in sales.

Walmart’s interest in India is the latest extension of the retailer’s battle with Amazon. Rooted for decades in its network of stores, Walmart has been trying to bolster its online offerings. In just the past few years, it has acquired the hip, largely online clothing brands Bonobos and ModCloth, started a higher-end mattress and bedding line sold exclusively online and expanded home grocery delivery to 100 American cities.

Based in Bangalore, Flipkart was founded in 2007 by Sachin Bansal and Binny Bansal. The two men, who are not related, worked briefly at Amazon’s back-office operations in India before deciding to form their own company.