Rakuten Inc. shares recorded their biggest gain in 18 years after investors bet that a ¥242 billion stake sale and deepening collaboration with partners like Tencent Holdings Ltd. and Japan Post Holdings Co. will help the company acquire customers and shore up its logistics network.

The stock rose its maximum of 24.1% in Tokyo, pushing Rakuten’s value up by more than ¥327.4 billion, after it announced Friday it was raising ¥242 billion selling stock to investors including Tencent, Japan Post and Walmart Inc. Japan’s e-commerce pioneer intends to use the funds to expand its capabilities in artificial intelligence, financial technology and mobile networks. It recently became the fourth mobile carrier in its domestic market, undercutting the incumbents with aggressive pricing.

The deal is expected to help bankroll Rakuten’s costly effort to build out its delivery network and compete with Amazon.com Inc. It plans to create joint logistics centers with Japan Post, sharing data and delivery and pick-up systems to improve efficiency.