Following online travel services and food delivery, online movie ticket booking has become the latest corner of the O2O (online to offline) market to see consolidation after years of cutthroat price wars.

The landscape of the online movie-ticket market has changed since February, when Baidu-backed, group-buying site Nuomi stopped subsidizing its users, bowing out of the price wars.

“As Baidu quit, the market balance suddenly changed,” said Lin Ning, founder of Weiying, one of the largest online movie-ticket agents.

The retreat of Nuomi left the market with three major players – Weiying, Maoyan and Alibaba-backed Tao Piao Piao.

But market reshuffling continues. On Sept. 21, Beijing-based studio Enlight Media, Maoyan’s largest shareholder with a more than 77% stake, said the company would merge with Weiying. The new entity, Maoyan Weiying, is valued at more than 13 billion yuan and controls more than 40% of China’s online ticketing market.

Weiying will initially inject a major part of its online movie and performance ticketing units–valued at nearly 4 billion yuan–into Maoyan and get a 27.6% stake in the new company, according to a statement. At the same time, Weiying’s founder and major shareholder Tencent agreed to invest 897 million yuan for 6.6% of the new company.

After the transaction, Enlight Media will remain the largest shareholder of the new company, with a 50.7% stake, followed by Weiying, Meituan Dianping and Tencent.

Sources close to the matter said that Weiying will inject its remaining ticketing business into the new company via two to three tranches, pushing the company’s value up to as much as 20 billion yuan. Tencent, meanwhile, will seek a larger stake with future investments, the sources said.

Tencent was the major driving force behind the deal, which took nearly a year of negotiations to achieve, according to an industry source.

Tencent has interests in both companies. Its group-buying subsidiary Meituan Dianping founded Maoyan in 2012 and currently holds 12.8% of the company after a majority stake sale to Enlight Media last year. Tencent founded Weiying with other investors in 2014 and owns about 16% of the company.

The two companies have very similar business.

“The best solution (for Tencent) is to merge them and focus all resources in one single company,” said a source close to Weiying.

The tie-up of Maoyan and Weiying will create a stronger rival to Alibaba’s online ticketing business, which consists of the movie ticket platform Tao Piao Piao and performance ticket platform Damai.

As of March, Tao Piao Piao held 20% of China’s online movie ticket market, nearly doubled from the same time last year, according to data from market information provider Analysys.

During the summer holiday in July and August, Tao Piao Piao climbed to the top of online movie ticker sellers, claiming 31% of the market, exceeding Maoyan’s 30% and Weiying’s 22%, according to Analysys.

Tao Piao Piao’s fast growth contributed significantly to Alibaba’s film business, which registered 243% growth in revenue last year, Alibaba Pictures Group said in its financial report.

The online movie-ticket market witnessed its fastest growth in 2015, when platforms poured in billions of yuan in subsidies to win market share. That year, online movie-ticket sales accounted 72% of China’s total box office revenue, which rose 49% year-on-year to a record of 44 billion yuan.

As of March 2016, nearly 80% of the online movie-ticket market was controlled by the top four players, namely Maoyan, Weiying, Baidu’s Nuomi and Tao Piao Piao, according to Analysys.

But the upbeat growth didn’t last long.

In 2016, China’s box-office revenue grew 3.7% to 46 billion yuan, the slowest growth in 10 years. Meanwhile, the share of online ticket sales only rose 1.5% from the previous year.

Xu Wu, a founder of Maoyan, said the share of online movie-ticket purchase is reaching its peak and the market’s growth will inevitably slow.

Amid the slowdown, business reshuffling has started among major players.

In May 2016, Meituan Dianping sold 57.4% of Maoyan to Enlight Media in hopes of tying the ticket business with content production to fuel future growth, said Wang Huiwen, vice president of Meituan Dianping.

What Maoyan needs is not so much more customers as a transformation of its business model and space for future growth, said Wang Changdian, chairman of Enlight Media.

At the same time, Maoyan and Weiying have started negotiating over a possible merger to counter challenges from Alibaba.

And then there’s Baidu.

While Alibaba and Tencent have continued expanding their territories, Baidu has seen its share slide in the online movie-ticket market. As of March this year, Baidu Nuomi’s share declined to 13.8% from nearly 20% last year.

With Baidu deciding to stop subsidies, its further retreat from the market is imminent.

“It was surprising,” Lin said. “Many thought the (price) war would last for another year.”

Having lost the game to Alibaba and Tencent, Baidu’s withdrawal from the online ticket market is part of the company’s strategy to shift its business focus from O2O to artificial intelligence.

In addition, Baidu in August offloaded its money-losing meal-delivery unit Waimai to Alibaba-backed Ele.me for $500 million, further stepping away from the O2O sector.

But for Alibaba and Tencent, the battles of O2O will continue. Fan Luyuan, chief executive of Tao Piao Piao, told Caixin in late August that the company will continue subsidizing its users to fight for the top position in the market.

Behind the ticketing business battle is Tencent and Alibaba’s ambition in the broader entertainment market. Both companies have set up film and TV show production subsidiaries and competed in investing in major film studios over the past few years. They are building a business chain involving content production, distribution and ticket sales, backed by their successful payment and social media platforms.

Internet giants are behind most of China’s film-making companies, said one film industry insider.

Yu Yongfu, chief executive of Alibaba’s entertainment business division, said Alibaba will set no limit on subsidy supports to Tiao Piao Piao.

“Tao Piao Piao is the infrastructure (of the entertainment business), and it is only with money that one can build a solid infrastructure to support broader business and new products,” Yu said.

China Film Insider reports on and writes about the people and companies making movies that soon may help to bridge the gaps in understanding between China, the United States, and the rest of the world. We work in Beijing, Los Angeles, and New York.