SHANGHAI — As China tries to reshape the narrative of its fumbled response to the coronavirus outbreak, it is turning to a new breed of police that carry out real-world reprisals for digital misdeeds.

The internet police, as they are known here, have gained power as the Communist Party has worked to seize greater control over the thoughts, words, and even memories of China’s 800 million web users. Now, they are emerging as a bulwark against the groundswell of anger over governance breakdowns that exacerbated the epidemic.

Officers arrive with an unexpected rap at the door of online critics. They drag off offenders for hours of interrogation. They force their targets to sign loyalty pledges and recant remarks deemed politically unacceptable, even if those words were made in the relative privacy of a group chat.

In the central city of Chengdu, a recent law school graduate, Li Yuchen, said he was pulled from his home in early February after writing a sarcastic treatise in classical Chinese about censorship. The police questioned him from late afternoon until midnight, first asking him whether he loved his country, to which he said yes. Mr. Li said he was forced to sign a statement disavowing his views and pledging loyalty to the party.