Walmart Inc. raised about $3.6 billion by selling its stake in Chinese e-commerce firm JD.com Inc., winding down an eight-year partnership that appears to be paying diminishing returns amid a challenging landscape for Chinese tech giants.

The US retailer sold 144.5 million shares for $24.95 apiece, people familiar with the matter said, asking not to be identified because the information is private. That’s a discount of 11% to Tuesday’s close in the US, according to Bloomberg calculations, and near the lower end of an indicative $24.85 to $25.85 price range.

JD.com’s Hong Kong-listed shares fell as much as 12% on Wednesday, leading a broader selloff in Chinese e-commerce and tech stocks. Walmart is refining its strategy in the world’s second-largest economy, where its long-standing e-commerce partner is struggling along with traditional rivals Alibaba Group Holding Ltd. and Temu-owner PDD Holdings Inc.

The US firm has built a mature e-commerce and delivery system in China for both Sam’s Club and its hypermarkets business and is focusing on its own offerings, a person familiar with the matter said, speaking on condition of anonymity. The deal also comes as a property crisis, market volatility and uncertain job prospects take a toll on Chinese consumption.

Morgan Stanley is the broker-dealer handling the offering, according to people familiar with the situation. JD.com also bought back $390 million of its shares today.