(Bloomberg) -- Baidu Inc. posted a surprise rise in revenue, after efforts to expand in areas such as cloud computing and autonomous driving offset weak ad sales in China.

Revenue inched 1% higher to 28.4 billion yuan ($4.2 billion) for the three months ended March, compared with the 27.9 billion yuan forecast by analysts. Net loss was 885 million yuan, versus an estimated profit 142 million yuan. The company has stopped giving revenue guidance since the October-December quarter, citing common practice among other US-listed companies on the Hong Kong Exchange.

China’s internet search leader is in the midst of reinventing itself from an online marketing company to a hard-tech supplier of self-driving systems, cloud computing and chips. The country’s weakening economy, coupled with Covid lockdowns in cities like Shanghai and Beijing, has hammered advertising spending and other consumer activity. That’s given urgency to Baidu’s push to monetize its artificial intelligence tech.

Covid outbreaks continue to curb appetite for ad placement, and this is likely to hurt April revenues more, Bocom International analysts led by Connie Gu wrote in a note before the results. They estimated Baidu’s ad revenue will decline a further 13% in the current quarter.

Baidu is preparing to launch a fully driverless ride-hailing platform in China in 2023, after nabbing a first-of-its-kind testing license from regulators in April. The company has said it plans to expand the robotaxi service into 100 cities across the country by 2030. It’s also looking to raise about $300 million in a new financing round for its AI chip spinoff Kunlun, Bloomberg News reported, to tap more external clients.

For now, Baidu is counting on its flagship search-feed app and Netflix-style streaming affiliate iQiyi Inc. to retain users and advertisers. While Beijing’s attempts to open up the country’s internet ecosystem and deflate its most powerful tech giants may benefit Baidu, it’s fighting an uphill battle against more addictive social media offerings from Tencent Holdings Ltd. and ByteDance Ltd.

©2022 Bloomberg L.P.