Chinese internet giant Baidu announced on Tuesday "accelerated" revenue growth in the second quarter, as the country's digital sector recovers from a tough crackdown despite a slowing domestic economy.

Beijing tightened the reins on its tech titans from 2020, bringing a string of influential firms to heel with new regulations and hefty fines.

But amid a faltering post-pandemic recovery, authorities indicated last month that its campaign against the industry -- a key source of growth and jobs -- was finally winding down.

Baidu said in an earnings report on Tuesday it made a profit of $718 million in the three months through June, a year-on-year rise of 43 percent.

Revenue was $4.7 billion, up 15 percent from the equivalent period last year and well above forecasters' expectations.

"In the second quarter of 2023, Baidu Core accelerated revenue and profit growth, driven by the solid performance of online marketing business and operating leverage," Baidu CEO Robin Li said in a news release on Tuesday.

Rival Tencent announced last week a 41 percent year-on-year jump in second-quarter net income, while e-commerce leader Alibaba reported an unexpected 14 percent on-year increase in quarterly sales.

Baidu said income from online marketing, which accounted for more than half its revenue, grew by 15 percent compared with the second quarter last year.

"The improvement in profit and margins as well as strong cash generation were primarily driven by revenue acceleration and efficiency gain," Rong Luo, CFO of Baidu, said in the news release.

Baidu has faced increased competition in recent years from domestic rivals including Tencent -- which operates the WeChat messaging platform -- and ByteDance, which runs the Chinese version of short-video sensation TikTok.

Against this backdrop, Baidu has sought to diversify into cloud computing, autonomous driving, artificial intelligence (AI) and other sectors.

In March, Baidu unveiled an AI-powered chatbot similar to ChatGPT, the programme developed by US-based OpenAI whose prowess made global headlines following its release last year.

But Baidu's "Ernie Bot" failed to live up to expectations, with the company's shares plunging by 10 percent after a pre-recorded demonstration of its capabilities instead of a live interaction.