Amazon Inc. and Walmart Inc.’s plans to dominate India’s online retail landscape have been ambushed by Prime Minister Narendra Modi’s political priorities heading into a tightening election.

The vote, which must be held by May, has increased the influence of local retailers that lobbied for growth-crimping curbs on the U.S. giants. On cue, India this month rolled out constraints on foreign e-commerce players, including Jeff Bezos-led Amazon and Walmart-owned Flipkart, which together control 70 percent of its online shopping.

The tighter rules, aimed at protecting small traders, may end up benefiting the country’s richest man, Mukesh Ambani, who is building a homegrown competitor.

Modi’s Bharatiya Janata Party is still licking its wounds after being trounced in three key recent state polls and a year ago fighting an unexpectedly close contest in Gujarat — Modi’s home state. Among small businesses, which are a traditional support base, the government’s popularity has been eroded by 2016’s surprise cash ban and the subsequent chaotic rollout of a new sales tax.

The rules now bar Amazon and Flipkart Online Services PTE from owning inventory and require them to treat all vendors equally, throttling discounts and exclusives — a huge advantage to homegrown companies, including Ambani’s new venture. His Reliance Industries Ltd., which owns India’s largest retail chain and third-biggest telecommunications network, has the potential to evolve into a local version of Amazon or Alibaba Group Holding Ltd., UBS AG said last month.

“Whether serendipitous or not, India’s tightened regulatory regime for online retailers is a huge win for Reliance with its new retail ambitions,” said Sanchit Vir Gogia, chief executive officer of consultancy Greyhound Research. “This could be a field leveler for them.”

Ambani wants his consumer offerings — covering telecommunications, fiber-to-home broadband, media and entertainment, and retail — to contribute nearly as much to the conglomerate’s overall earnings as its bread-and-butter energy and petrochemical businesses.

He is fresh from disrupting the nation’s telecom sector, which he entered in 2016 with services so cheap that rivals have quit, merged or gone bankrupt — including a carrier controlled by his younger brother.

On the back of that success, he last year unveiled plans to create a model that combines Reliance’s consumer offerings into a “hybrid, online-to-offline new commerce platform.”

Analysts at UBS predict Reliance can gain market share in new-age retail given its starting point of 280 million telecom subscribers, a broadband offering, extensive content and a web of 10,000 stores nationwide. The company also wants to partner with India’s 12 million mom-and-pop shops to create distribution and delivery centers.

Reliance resembles Alibaba in its ability to offer bundled services in a fast-growing, fragmented market with low online penetration, according to UBS.

“In retail/e-commerce, despite competition from well-funded global companies, Reliance’s wide footprint of physical stores along with its omni-channel focus, subscriber reach and regulations governing foreign e-commerce entities,” could help it gain market share, analysts wrote in a Jan. 24 report.

The U.S. retail giants are being curbed in a market where they have committed billion of dollars and, until recently, seemed to have already won.

Both Amazon and Walmart will have to reduce cash-back payments and discounts — a sore point for smaller sellers, who accuse the pair of predatory pricing. To meet rules, the companies have also removed thousands of products from virtual shelves, must redraw contacts with merchants and brands and are bracing for a full-fledged e-commerce policy that is under review.

Flipkart’s losses may rise 20 percent to 25 percent following the changes, according to Morgan Stanley, which said in a report that it didn’t think Walmart was considering walking away from the investment. The world’s largest retailer is “financially and strategically invested in India,” analysts wrote, adding that it may make sense to exit if Walmart can’t see a long-term path to profits.

Walmart has suffered other setbacks. During the course of its Flipkart acquisition and soon after, it lost the co-founders of its new purchase. Their know-how and connections would have helped the U.S. retailer better navigate this latest regulatory wrinkle.

Reliance will probably use the opportunity posed by the government’s tighter rules to make a “grand entry” into e-commerce, said Praveen Khandelwal, secretary-general for the Confederation of All India Traders, a lobbying group that had threatened political repercussions if the Feb. 1 rollout was delayed.

Ambani had last month mapped out the beginnings of his strategy, which involves rolling out a shopping platform to 1.2 million store owners in western India. As the initiative expands, the company will enlist more neighborhood shops as distribution and delivery centers for products that will be available on its mobile platform, people familiar with the plans said at the time.

An integrated platform will probably be launched within 18 months, the people had said.

“Our agenda is to ensure a level playing field,” Khandelwal said. “Players such as Amazon and Walmart are in a major fix post the new guidelines, and they will take time to restructure their operations.’

Neighborhood stores have already started working with the big online retailers such as Amazon, leveraging their advantages of last-mile access and familiarity with their customers.

“We have been around for many years and know our customers very well,” said Laiji Varghese, owner of a small provision store on the outskirts of Mumbai. That is why “Amazon and Reliance want to tie up with us.”