Hong Kong CNN Business  — 

Walmart is retreating from Japan, giving up on a near 20-year attempt to crack the grocery market in the world’s third largest economy.

Walmart (WMT) is selling most of its stake in Japanese supermarket chain Seiyu to KKR and Rakuten (RKUNF) in a deal that values Seiyu at 172.5 billion yen ($1.6 billion).

The deal will give private equity fund KKR majority ownership of Seiyu with a 65% stake, Japanese e-commerce leader Rakuten will own 20% and Walmart will hold on to 15%, the companies said in a statement on Monday.

Rakuten and KKR said they will accelerate investment in Seiyu’s digital operations, as the pandemic drives up demand for online shopping in Japan.

“We look forward to accelerating digital transformation of Seiyu brick and mortar retail and further merging the best of offline and online retail,” Kazunori Takeda, Rakuten’s executive vice president, said in a statement.

Seiyu operates more than 300 stores throughout Japan. The deal with Rakuten and KKR is subject to regulatory approvals and is expected to close early next year.

With sluggish growth in its home market, Walmart has in recent years been ramping up its international operations in countries such as India and China.

But in Japan, it struggled to find success in a market dominated by local competitors such as Aeon and Seven & I Holdings (SVNDF), owner of 7-Eleven convenience stores. With its near exit of Seiyu, Walmart becomes the latest foreign casualty in the country’s supermarket wars. France’s Carrefour (CRERF) exited the market in 2005, and Britain’s Tesco (TSCDF) left in 2011.

The American big box retailer first invested in Seiyu in 2002. In the early years, Walmart plowed more than $1 billion into the company, and brought in its own distribution and computer systems. The efforts failed to deliver a breakthrough, however, and its stores struggled to overcome consumer apathy and a saturated retail market. Walmart took Seiyu private in 2008.

In 2018, Walmart teamed up with Rakuten to set up an online grocery platform in Japan and to sell e-books to American consumers.