As Tencent HoldingsTCEHY +0.20% and Alibaba Group Holding fight for supremacy in China’s vast Internet sector, the two giants have been moving further into each other’s territories.

In the latest development, Tencent said Wednesday that it has agreed to buy a 9.9% stake in logistics firm China South City Holdings1668.HK +60.83% for HK$1.5 billion (US$193 million), with an option to raise its stake to about 13% over the next two years. The two firms said they would work together in e-commerce as well as offline trade services.

Tencent’s investment comes as the Shenzhen-based company, a giant in online gaming and social networks in China, is beefing up its e-commerce capabilities to challenge Hangzhou-based Alibaba, which has so far dominated China’s fast-growing market for online shopping.

Tencent operates some of the most popular online services for China’s PC and mobile users, such as its QQ and WeChat messaging services. Analysts say Tencent could take advantage of the vast user base for its online communication services to offer more lucrative services such as e-commerce. Tencent’s WeChat smartphone app has more than 272 million monthly active users worldwide, with the majority of them in China, according to the company. Last year, Tencent added an electronic payment feature to WeChat, a step toward turning the messaging tool into a platform for e-commerce and other paid services.

Still, operating an e-commerce business requires a range of offline resources such as warehouses and delivery services, and Alibaba, which has been running shopping sites for more than a decade, has an advantage. Even though Alibaba doesn’t own all of the offline resources, the company has invested in warehouses and works with many logistics partners. Last year, Alibaba formed a consortium with retailers and parcel delivery firms to work on logistics infrastructure. Last month, Alibaba agreed to create a logistic joint venture with Chinese home appliances maker Haier Electronics Group in a HK$2.82 billion (US$364 million) deal.

For both Tencent and Alibaba, a big challenge is how to design a strong mobile business strategy to stay competitive when more Chinese Internet users access online services with their smartphones.

While WeChat’s popularity among Chinese smartphone users gives Tencent an advantage, Alibaba has been trying harder to attract smartphone users. Last year, Alibaba invested in Sina’s Twitter-like Weibo service and integrated some of its e-commerce service into the microblog. Earlier this month, Alibaba said that it is planning to launch a mobile gaming service.