China's top Internet search company is engaging in a rare display of soul searching following the death of a student who used it to look for cancer treatments.

In a letter to employees, Baidu (BIDU) founder Robin Li said the company's "values have been squeezed out of shape" by the pursuit of higher revenues.

"In the middle of the night, I often think, 'Why do so many daily Baidu users no longer love us? Why do we no longer feel a sense of pride in our own products?' " he wrote.

Baidu is at the center of a controversy over how accountable Internet firms are for the search results they provide.

The debate was spurred by the story of Wei Zexi, a young man in his early twenties who was suffering a rare form of cancer.

In a desperate move to save him, Wei's parents borrowed money and sought an experimental treatment at a military hospital in Beijing they found using Baidu search. The treatment failed, and Wei died less than two months later.

As the story spread, scathing attacks on the company multiplied, first across Chinese social networks and then in traditional media.

After an investigation, Chinese officials told Baidu to change the way it displays search results, saying they are not clearly labeled, lack objectivity and heavily favor advertisers.

Baidu said it would implement the changes recommended by regulators, and change its algorithm to rank results based on credibility.

In addition, the company has set aside 1 billion yuan ($153 million) to compensate victims of fraudulent marketing information.

Related: Baidu ordered to clean up search results after student's death

Making amends is vital: Li said in his letter that Baidu would go bankrupt within 30 days without the support of its online users and customers.

Baidu doesn't disclose ad revenues by sector, but has said that health care was one of its "top revenue verticals" last year. Shares in the company have lost more than 10% over the past five trading sessions.

The military hospital involved in the case has also been reprimanded: A separate investigation conducted by health authorities and the military found it misled the public by illegally outsourcing services and publishing fake medical ads.

-- Steven Jiang and Yazhou Sun contributed reporting.