China's biggest internet search engine is suing a comedian after he mocked the company and its CEO on social media.

The comedian, who posts under a pseudonym, said that Baidu (BIDU) is claiming that he defamed Robin Li, its founder and chief executive, and damaged the company's reputation and public image.

In a statement to CNN on Thursday, Baidu confirmed the lawsuit but declined to comment further.

The comedian — who requested to be identified only by his last name, Sun, because of the sensitivity of the matter — told CNN he was shocked to see "a company of this size sue an individual over a joke."

On Wednesday, he posted several pages of Baidu's legal complaint on his verified account on Weibo (WB), China's equivalent of Twitter (TWTR). The documents appear to show that the company is demanding more than 5 million yuan ($732,000) in damages and a public apology.

Dig at search results

Sun, who goes by the user name "Monologue at 7:30," posted the offending joke in May, when a rumor about Li's personal life was circulating online. Baidu vehemently denied the rumor and reported it to Chinese authorities.

Sun's post referenced the rumor and Baidu's response, adding a punchline that many Chinese internet users took as a dig at the company's search results. Baidu has been criticized in recent years for prominently placing links paid for by advertisers in search results, some of which have taken users to fraudulent businesses.

In one high-profile case in 2016, a young cancer patient died after his parents sought an experimental treatment for him at a hospital in Beijing based on Baidu search results. The case prompted outrage online, and China's cyberspace regulator ordered the company to change the way it displays results. Baidu said after the outcry that it had removed around 126 million promotional messages from its site.

Government's tightening grip

Baidu's lawsuit against Sun comes at a time when China's ruling Communist Party continues to tighten its grip on the country's cyberspace, which is already one of the world's most regulated thanks to a sophisticated nationwide firewall and an army of state and corporate censors.

Under President Xi Jinping's order to "clean" the internet, the authorities are hardening their stance toward online humor and satire, which are often used as a way of making veiled criticisms of the government.

Earlier this year, the government passed a law making it a crime to slander Communist martyrs. Officials have shut down the social media accounts of offenders and ordered them to apologize and pay fines.

In April, the government shut down an online joke-sharing platform, Neihan Duanzi, which had more than 200 million users. Authorities said it contained vulgar content.

The government launched a platform this week aimed at "alerting the public about online rumors and refuting slanders," according to Xinhua, the official news agency.

'Kill a chicken to scare the monkeys'

Sun's legal plight has attracted huge attention across the Chinese internet. The number of Weibo accounts following him have skyrocketed from around 10,000 earlier this week to more than 27,000. Most of the comments under his post about the lawsuit, which has been pinned to the top of his Weibo page, have been supportive.

Tony Chou, a Chinese comedian who has worked closely with Sun, said their small but close-knit circle is concerned about the case because of its potentially chilling effect.

"Baidu may want to 'kill a chicken to scare the monkeys,' just when a young generation of comedians start to evolve from the old model of 'stay away from the reality' to becoming more willing to talk about social issues," he told CNN.

Chou regularly performs stand-up gigs in bars and clubs in Beijing, and produces his own comedy videos. Sun has written for Chou for some of his shows.

Sun said he is determined to keep writing jokes the way he always has and fight his legal battle to the end.

"I've always known how difficult it is to create satire in our environment, but I didn't realize the situation had become so bad," he said on Weibo. "If we are no longer allowed to even make fun of Baidu, I don't know what will happen next."

"I can't afford to lose this case."

-- Yong Xiong in Beijing contributed reporting to this article.