Chinese tech group Baidu eked out better-than-expected quarterly revenue Tuesday, thanks to a 31% jump in its cloud business that offset slowing online ads for China’s largest search engine.

Total revenue shrank 5% on the year to 29.65 billion yuan (USD 4.3 billion) in the second quarter, slightly higher than the average estimate of 29.30 billion yuan from analysts surveyed by Refinitiv. The company swung to a net profit of 3.64 billion yuan from a year-earlier loss.

Nasdaq- and Hong Kong-listed Baidu’s ad revenue, which contributes around 62% of its total revenue, fell 10% year over year in the second quarter as China’s economy slowed.

Chief Executive Robin Li blamed the decline on the impact of COVID-19 on major cities, especially Shanghai and to a lesser extent Beijing, in April and May, but said ad revenue started to recover since June.

“Looking into the second half of the year, we are still facing macro uncertainties,” Li said in an earnings call. “It is hard for us to predict the development of COVID-19 at this stage.”

Baidu’s shares were down roughly 8% in early trading in New York.

Apollo Go, Baidu’s autonomous ride-hailing service platform, completed 287,000 rides in the June quarter, increasing almost 500% year over year, and it has accumulated a total of more than one million trips so far. It has also obtained about a 10% market share of ride-hailing services in Beijing’s Yizhuang region, where more than 100 Apollo Go vehicles have been put into service, Li said.

Li attributed the growth of its cloud and intelligent driving businesses to their alignment with the Chinese government’s “repeated calls for technology innovation.”

The Chinese search engine giant has invested heavily in autonomous driving technologies over the past five years, in an effort to rebrand itself as a supplier of deep technology.

Earlier this month, the company secured permits to put fully driverless taxis on the road in two major cities for the first time. Last week, the company also revealed its first quantum computer and is ready to make it available to external users.

On its stock market presence, Chief Financial Officer Rong Luo was asked whether the company would upgrade its status on the Hong Kong stock exchange, where it conducted a secondary listing last year, to its primary listing, like its peers Alibaba Group Holding and Bilibili have done.

“The process of switching from the secondary to primary listing in Hong Kong should be straightforward, and we don’t see any kind of hurdles for us to achieve that,” Luo said.

Baidu, along with three other stocks, will be added to Hong Kong’s Hang Seng Index next month amid the biggest-ever overhaul of the city’s stock market benchmark.

Baidu’s Netflix-like video platform iQiyi reported weaker-than-expected revenue of 6.7 billion yuan, decreasing 13% from the same period last year. Nasdaq-listed iQiyi shares plunged more than 9% in early trading.

This article first appeared on Nikkei Asia. It has been republished here as part of 36Kr’s ongoing partnership with Nikkei.