Baidu (BIDU), China's leading internet search company, is reportedly selling its takeout delivery service to Ele.me, the food delivery company, which is backed by Alibaba (BABA).

Citing people familiar with the deal, The Wall Street Journal reported an announcement could come this week and is designed to stem the tide of Baidu pouring tons of money into a service that hasn’t paid off for the company. The takeout delivery business, called Waimai, has a market value of around $2.5 billion, reported the Journal, noting that Ele.me has a market worth up to $6 billion. The deal is comprised of cash and stock, although the Journal didn’t have the price tag as of yet. One of the sources said Alibaba and its Ant Financial unit are helping bankroll the purchase for Ele.me. Once completed, Waimai shareholders will get a minority stake in the combined company, noted the report.

A Still-Growing Market

The move on the part of Baidu comes a time when it is shifting its focus to artificial intelligence, recently teaming with NVIDIA Corp. (NVDA) to push AI into the automotive market as well as launch other AI initiatives. It also signals a big retreat for the company and its plan to bring on-demand services to the digital world. Baidu said back in 2015 it would spend more than $3 billion during the course of three years to bring delivery and group buying to mobile phones, reported the Journal. (See also: NVIDIA, Baidu Team for Multiple Projects.)

Blending the offline and online worlds has been the battle cry for Alibaba, Baidu and rival Tencent for some time now. Alibaba and Tencent are having a lot of successes with their efforts, which investors have rewarded with huge surges in their shares prices. Food delivery in China is emerging as a big battleground for the two, which have been pouring tons of money into the sector. In May, Alibaba invested $1 billion in Ele.me to help it compete against a service that is backed by Tencent called Meituan Dianping. (See also: Alibaba Leads $1Bn Investment In Chinese Food Startup.)

The market for services provided via a mobile phone, whether to place food delivery orders or book beauty treatments, is booming in China. Bloomberg noted in a report at the time the sales of these type of services are forecasted to hit $1.1 trillion in 2017. The food delivery market in China is attractive to both Alibaba and Tencent because it is one of the retail segments that is still seeing growth. Alibaba is currently the largest shareholder in Ele.me and Tencent, which holds a minority stake, is looking to ramp up investment, according to Bloomberg. Alibaba also has its Koubei service that enables users to book spa treatments and restaurants reservations from their mobile phones.