China has shut down thousands of websites and online accounts following a three-month campaign against "harmful" content, the state news agency Xinhua has announced.

The content, on 4,000 sites, included infringements of copyright and material spreading "improper values, vulgarity or obscenity", it said.

But the purge also appeared to be aimed at platforms offering free e-books.

China tightly controls the country's internet access.

Previous targets have included lottery apps and material containing pornographic or violent content.

Free material
BBC analyst Kerry Allen said such crackdowns were not uncommon.

"There have been a number of these crackdowns before, and Chinese people come to expect that they are not websites that they will regularly access, or any that they are reliant on," she said.

Referring to the platforms offering free e-books, Ms Allen added: "The media are definitely emphasising that the crackdowns are more related to people reading stuff that they should be paying for, rather than accessing subversive content."

There were reports in August that Google was planning a new censored Chinese service which would block certain websites in keeping with local regulation.

Google has never commented on the reports but hundreds of employees wrote to the company in protest following the coverage.

"We urgently need more transparency, a seat at the table, and a commitment to clear and open processes. Google employees need to know what we're building," the letter said.