The literary inquisition (Chinese: 文字獄; pinyin: wénzìyù; literally: "imprisonment due to writings") or speech crime (Chinese: 以言入罪) refers to official persecution of intellectuals for their writings in China. The Inquisition took place under each of the dynasties ruling China, although the Qing was particularly notorious for the practice. Such persecutions could owe even to a single phrase or word which the ruler considered offensive. Some of these were due to naming taboo, such as writing a Chinese character that is part of the emperor's personal name. In the most serious cases, not only the writer, but also his immediate and extended families, as well as those close to him, would also be implicated and killed.
The practice of literary persecution has been recorded since Qin dynasty, and has been used by almost all successive dynasties ruling China. It is uncertain how frequently the persecutions occurred. The poet Su Shi of Song dynasty was jailed for several months by the emperor due to some of his poems. In the classical novel Water Margin, set in Song dynasty, one of the protagonists, Song Jiang, who was originally a minor official, was sentenced to death for writing a poem advocating rebellion against the government while he was drunk. He was saved and later became the chief of an outlaw band.
There are records of literary persecutions during the Ming dynasty and the beginning of the period saw the most severe persecutions. Before he became emperor, Zhu Yuanzhang (the Hongwu Emperor), the Ming dynasty's founder, was illiterate and had been a beggar. While he established his empire, he surrounded himself with scholars, treating them with respect while he learnt to read and familiarise himself with history. He sent out requests to scholars for their presence, and while many agreed others declined for fear of the repercussions if they made a mistake. On occasion the emperor, who was learning to read, would order the execution of someone who had written something he misunderstood.
The rulers of the Manchu-led Qing dynasty are particularly notorious for their use of literary inquisitions. The Manchus were an ethnic minority who had defeated the Han Chinese-led Ming dynasty; as such, they were sensitive to public sentiments towards them. Writers and officials usually took the stance of drawing distinctions between the Han Chinese and the Manchus; the latter were traditionally viewed as barbarians in Han Chinese culture. However, while the Manchus were in charge, writers resorted to veiled satire. According to Gu Mingdong, a specialist in Chinese literature and intellectual thought, the Manchus became almost paranoid about the meanings associated with the Chinese characters for 'bright' and 'clear', 'Ming' and 'Qing' respectively. One inquisition was the "Case of the History of the Ming Dynasty" (明史案) in 1661–1662 under the direction of regents (before the Kangxi Emperor came in power in 1669) in which about 70 were killed and more exiled.
Under the Qing dynasty, literary inquisition began with isolated cases during the reigns of the Shunzhi and Kangxi emperors, and then evolved into a pattern. There were 53 cases of literary persecution during the reign of the Qianlong Emperor. Between 1772 and 1793, there was an effort by the Qianlong Emperor to purge "evil" books, poems, and plays. He set out to get rid of works by Ming loyalists who he believed were writing subversive anti-Qing histories of the Manchu conquest. The scale of the destruction cause by this "literary holocaust" is uncertain due to gaps in the imperial archives, however as many as 3,000 works may have been lost. An estimated 151,723 volumes were destroyed by the inquisition in this period. Amongst the works subject to this treatment were books considered disrespectful towards the Qing emperors or previous ethnic minority dynasties that could be viewed as analogous to the Qing. From 1780 onwards, plays could also be destroyed if they were vulgar or contained anti-Manchu material. Writers who criticised the Qing dynasty could expect to have their entire work erased, regardless of content. The inquisition was often used to express local ambitions and rivalries that had little to do with the ruler's own political interests. It thus generated interclass, as well as intraclass, warfare. For example, commoners could lay charges against scholars.