(Bloomberg) -- Baidu Inc. posted a surprise gain in revenue after cost cuts helped prop up the bottom line and online advertising held up better than anticipated against China’s economic downturn.

Sales rose slightly to 32.5 billion yuan ($4.6 billion) in the September quarter, beating expectations for 31.8 billion yuan. The company posted a net loss of 146 million yuan in the quarter just ended after taking a fair value loss several times that amount on its investments. But adjusted profit, which strips out exceptional items, managed to beat Wall Street’s projections.

Baidu’s performance gives ammunition to investors who say China’s internet sector may be emerging from a two-year drought. Growth evaporated after Beijing launched a regulatory clampdown in 2020 on the private sector and pandemic curbs laid waste to consumer sentiment and supply chains. Baidu and rivals like Tencent Holdings Ltd. and Alibaba Group Holding Ltd. responded by reining in costly forays into new arenas and slashing costs to preserve margins.

China’s two largest internet companies posted better-than-expected net income last week, suggesting the sector’s new-found cost discipline is paying off. Analysts also expect Beijing to relax pandemic restrictions, giving the world’s No. 2 economy a much-needed lift next year. 

Baidu’s shares climbed 2.1% in pre-market trading in New York. Its Netflix-style subsidiary, iQiyi Inc., and video service Kuaishou Technology also reported better-than-expected revenue on Tuesday.

Read more: Kuaishou Revenue Beats Estimates After Fending off ByteDance

What Bloomberg Intelligence Says

Tencent and Alibaba’s bottom line beats have helped stabilize their earnings outlook, suggesting that along with China’s policy pivot, the worst may be over. While Tencent’s Meituan divestment drove some concerns for the rest of the sector, the move is in-line with tech regulatory reform and the impact on core operations should be limited.

- Marvin Chen, strategist

Click here for research.

Still, Baidu’s reliance on digital marketing leaves the Beijing-based company vulnerable to economic shocks in 2023, particularly if China’s much-anticipated re-opening progresses at a slow pace.

The company’s been trying for years to reinvent itself as a supplier of deep technology by expanding into self-driving systems, cloud computing and chips, but the economic downturn has chilled those efforts. It won approval earlier this year to deploy the first fully autonomous taxis on Chinese roads and unveiled a self-made quantum computer.

Baidu’s nascent AI cloud division is now its fastest growth engine, but it faces an uphill battle against market leaders including Alibaba and Huawei Technologies Co.

For now, Baidu continues to depend on its flagship news-search app to win advertising dollars and users from online entertainment platforms operated by Tencent and TikTok-owner ByteDance Ltd.

“We expect the recovery curve in the second half of 2022 to slow for China Internet given the ongoing rising COVID cases and mobility restrictions that impacted consumer sentiment and business activities,” Mizuho Securities analyst James Lee wrote last week.

--With assistance from Ville Heiskanen.

(Updates with details on investment losses from the second paragraph)

©2022 Bloomberg L.P.