Gong'an or crime-case fiction is a subgenre of Chinese crime fiction involving government magistrates who solve criminal cases. Gong'an fiction first appeared in the colloquial stories of Song dynasty. Gong'an fiction was then developed and become one of the most popular fiction styles in Ming and Qing dynasties. The Judge Dee and Judge Bao stories are the best known examples of the genre.
An actor portraying Bao Zheng reviewing a criminal case in Kaifeng Tribunal (開封府)
Judge Bao in Peking Opera, a frequent protagonist of gong'an novels.
The county magistrate or local magistrate, known by several Chinese names, was the official in charge of the xian ("county"), the lowest level of central government in Imperial and early Republican China. The magistrate was the official who had face-to-face relations with the people and administered all aspects of government on behalf of the emperor.
A magistrate holds court (late 19th century)
Ming dynasty magistrate.
The Kaifeng Court of Bao Zheng, a tourist attraction modeled after typical magistral office.
Yamen at Shaoxing Fu, Zhejiang Province, 1803.