NEW DELHI— Amazon.com Inc. has a multimillion-dollar plan to dive into the online grocery business in India, as looser restrictions finally allow it to sell some products directly to consumers.

New Delhi is set to give the online retail giant the green light to invest around $500 million over the next five years to build a nationwide network to stock and deliver groceries, a Trade Ministry official said.

The South Asian nation typically bars foreign companies from selling products directly to consumers to protect the countless mom-and-pop shops that form the backbone of its retail industry. Amazon has so far had to act as an online marketplace, providing online and logistics support for other companies rather than selling products directly to consumers.

Last year, India allowed foreign companies to sell groceries directly to consumers, provided the produce and processed foods are sourced locally. This opened the way for Amazon to use groceries as a launchpad to start selling directly to India’s more than 1.2 billion consumers.

“There is no problem with Amazon’s proposal” to start selling groceries online, said the official, who asked not to be named. “We will approve it this month.”